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 41 of file refvector.hxx.

Member Typedef Documentation

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

Definition at line 44 of file refvector.hxx.

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

Definition at line 46 of file refvector.hxx.

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

Definition at line 45 of file refvector.hxx.

Member Function Documentation

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 116 of file refvector.hxx.

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

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 60 of file refvector.hxx.

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

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 68 of file refvector.hxx.

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

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 76 of file refvector.hxx.

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 84 of file refvector.hxx.

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 92 of file refvector.hxx.

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 108 of file refvector.hxx.

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

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 100 of file refvector.hxx.

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

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

Definition at line 151 of file refvector.hxx.

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


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