LibreOffice Module oox (master) 1
Classes | Public Types | Public Member Functions | Private Member Functions | List of all members
oox::RefVector< ObjType > Class Template Reference

Template for a vector of ref-counted objects with additional accessor functions. More...

#include <refvector.hxx>

Inheritance diagram for oox::RefVector< ObjType >:
[legend]
Collaboration diagram for oox::RefVector< ObjType >:
[legend]

Classes

struct  FindFunctor
 
struct  ForEachFunctor
 
struct  ForEachFunctorWithIndex
 

Public Types

typedef ::std::vector< std::shared_ptr< ObjType > > container_type
 
typedef container_type::value_type value_type
 
typedef container_type::size_type size_type
 

Public Member Functions

value_type get (sal_Int32 nIndex) const
 Returns a reference to the object with the passed index, or 0 on error. More...
 
template<typename FunctorType >
void forEach (FunctorType aFunctor) const
 Calls the passed functor for every contained object, automatically skips all elements that are empty references. More...
 
template<typename FuncType >
void forEachMem (FuncType pFunc) const
 Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references. More...
 
template<typename FuncType , typename ParamType >
void forEachMem (FuncType pFunc, ParamType aParam) const
 Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references. More...
 
template<typename FuncType , typename ParamType1 , typename ParamType2 >
void forEachMem (FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2) const
 Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references. More...
 
template<typename FuncType , typename ParamType1 , typename ParamType2 , typename ParamType3 >
void forEachMem (FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3) const
 Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references. More...
 
template<typename FunctorType >
void forEachWithIndex (const FunctorType &rFunctor) const
 Calls the passed functor for every contained object. More...
 
template<typename FuncType , typename ParamType1 , typename ParamType2 >
void forEachMemWithIndex (FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2) const
 Calls the passed member function of ObjType on every contained object. More...
 
template<typename FunctorType >
value_type findIf (const FunctorType &rFunctor) const
 Searches for an element by using the passed functor that takes a constant reference of the object type (const ObjType&). More...
 

Private Member Functions

const value_typegetRef (sal_Int32 nIndex) const
 

Detailed Description

template<typename ObjType>
class oox::RefVector< ObjType >

Template for a vector of ref-counted objects with additional accessor functions.

An instance of the class RefVector< Type > stores elements of the type std::shared_ptr< Type >. The new accessor functions has() and get() work correctly for indexes out of the current range, there is no need to check the passed index before.

Definition at line 42 of file refvector.hxx.

Member Typedef Documentation

◆ container_type

template<typename ObjType >
typedef ::std::vector< std::shared_ptr< ObjType > > oox::RefVector< ObjType >::container_type

Definition at line 45 of file refvector.hxx.

◆ size_type

template<typename ObjType >
typedef container_type::size_type oox::RefVector< ObjType >::size_type

Definition at line 47 of file refvector.hxx.

◆ value_type

template<typename ObjType >
typedef container_type::value_type oox::RefVector< ObjType >::value_type

Definition at line 46 of file refvector.hxx.

Member Function Documentation

◆ findIf()

template<typename ObjType >
template<typename FunctorType >
value_type oox::RefVector< ObjType >::findIf ( const FunctorType &  rFunctor) const
inline

Searches for an element by using the passed functor that takes a constant reference of the object type (const ObjType&).

Definition at line 117 of file refvector.hxx.

References begin, and end.

Referenced by oox::vml::ShapeContainer::findShape().

◆ forEach()

template<typename ObjType >
template<typename FunctorType >
void oox::RefVector< ObjType >::forEach ( FunctorType  aFunctor) const
inline

Calls the passed functor for every contained object, automatically skips all elements that are empty references.

Definition at line 61 of file refvector.hxx.

References begin, and end.

Referenced by oox::ole::VbaFormControl::finalizeEmbeddedControls(), and oox::RefVector< ObjType >::forEachMem().

◆ forEachMem() [1/4]

template<typename ObjType >
template<typename FuncType >
void oox::RefVector< ObjType >::forEachMem ( FuncType  pFunc) const
inline

Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references.

Definition at line 69 of file refvector.hxx.

References oox::RefVector< ObjType >::forEach().

Referenced by oox::ole::VbaProject::attachMacros(), oox::vml::ShapeContainer::finalizeFragmentImport(), oox::ole::VbaFormControl::importStorage(), and oox::ole::VbaFormControl::moveEmbeddedToAbsoluteParent().

◆ forEachMem() [2/4]

template<typename ObjType >
template<typename FuncType , typename ParamType >
void oox::RefVector< ObjType >::forEachMem ( FuncType  pFunc,
ParamType  aParam 
) const
inline

Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references.

Definition at line 77 of file refvector.hxx.

References oox::RefVector< ObjType >::forEach().

◆ forEachMem() [3/4]

template<typename ObjType >
template<typename FuncType , typename ParamType1 , typename ParamType2 >
void oox::RefVector< ObjType >::forEachMem ( FuncType  pFunc,
ParamType1  aParam1,
ParamType2  aParam2 
) const
inline

Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references.

Definition at line 85 of file refvector.hxx.

References oox::RefVector< ObjType >::forEach().

◆ forEachMem() [4/4]

template<typename ObjType >
template<typename FuncType , typename ParamType1 , typename ParamType2 , typename ParamType3 >
void oox::RefVector< ObjType >::forEachMem ( FuncType  pFunc,
ParamType1  aParam1,
ParamType2  aParam2,
ParamType3  aParam3 
) const
inline

Calls the passed member function of ObjType on every contained object, automatically skips all elements that are empty references.

Definition at line 93 of file refvector.hxx.

References oox::RefVector< ObjType >::forEach().

◆ forEachMemWithIndex()

template<typename ObjType >
template<typename FuncType , typename ParamType1 , typename ParamType2 >
void oox::RefVector< ObjType >::forEachMemWithIndex ( FuncType  pFunc,
ParamType1  aParam1,
ParamType2  aParam2 
) const
inline

Calls the passed member function of ObjType on every contained object.

Passes the vector index as first argument to the member function.

Definition at line 109 of file refvector.hxx.

References oox::RefVector< ObjType >::forEachWithIndex().

Referenced by oox::ole::VbaFormControl::convertProperties().

◆ forEachWithIndex()

template<typename ObjType >
template<typename FunctorType >
void oox::RefVector< ObjType >::forEachWithIndex ( const FunctorType &  rFunctor) const
inline

Calls the passed functor for every contained object.

Passes the index as first argument and the object reference as second argument to rFunctor.

Definition at line 101 of file refvector.hxx.

References begin, and end.

Referenced by oox::RefVector< ObjType >::forEachMemWithIndex().

◆ get()

template<typename ObjType >
value_type oox::RefVector< ObjType >::get ( sal_Int32  nIndex) const
inline

◆ getRef()

template<typename ObjType >
const value_type * oox::RefVector< ObjType >::getRef ( sal_Int32  nIndex) const
inlineprivate

Definition at line 152 of file refvector.hxx.

References nIndex, and size.

Referenced by oox::RefVector< ObjType >::get().


The documentation for this class was generated from the following file: