20#ifndef INCLUDED_OOX_HELPER_REFVECTOR_HXX
21#define INCLUDED_OOX_HELPER_REFVECTOR_HXX
41template<
typename ObjType >
42class RefVector :
public ::std::vector< std::shared_ptr< ObjType > >
47 typedef typename container_type::size_type
size_type;
60 template<
typename FunctorType >
61 void forEach( FunctorType aFunctor )
const
68 template<
typename FuncType >
71 forEach( ::std::bind( pFunc, std::placeholders::_1 ) );
76 template<
typename FuncType,
typename ParamType >
79 forEach( ::std::bind( pFunc, std::placeholders::_1, aParam ) );
84 template<
typename FuncType,
typename ParamType1,
typename ParamType2 >
85 void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 )
const
87 forEach( ::std::bind( pFunc, std::placeholders::_1, aParam1, aParam2 ) );
92 template<
typename FuncType,
typename ParamType1,
typename ParamType2,
typename ParamType3 >
93 void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 )
const
95 forEach( ::std::bind( pFunc, std::placeholders::_1, aParam1, aParam2, aParam3 ) );
100 template<
typename FunctorType >
108 template<
typename FuncType,
typename ParamType1,
typename ParamType2 >
111 forEachWithIndex( ::std::bind( pFunc, std::placeholders::_2, std::placeholders::_1, aParam1, aParam2 ) );
116 template<
typename FunctorType >
124 template<
typename FunctorType >
132 template<
typename FunctorType >
144 template<
typename FunctorType >
Template for a vector of ref-counted objects with additional accessor functions.
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 elemen...
value_type get(sal_Int32 nIndex) const
Returns a reference to the object with the passed index, or 0 on error.
::std::vector< std::shared_ptr< ObjType > > container_type
void forEachWithIndex(const FunctorType &rFunctor) const
Calls the passed functor for every contained object.
value_type findIf(const FunctorType &rFunctor) const
Searches for an element by using the passed functor that takes a constant reference of the object typ...
void forEach(FunctorType aFunctor) const
Calls the passed functor for every contained object, automatically skips all elements that are empty ...
const value_type * getRef(sal_Int32 nIndex) const
void forEachMemWithIndex(FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2) const
Calls the passed member function of ObjType on every contained object.
void forEachMem(FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2) const
Calls the passed member function of ObjType on every contained object, automatically skips all elemen...
void forEachMem(FuncType pFunc, ParamType aParam) const
Calls the passed member function of ObjType on every contained object, automatically skips all elemen...
void forEachMem(FuncType pFunc) const
Calls the passed member function of ObjType on every contained object, automatically skips all elemen...
container_type::value_type value_type
container_type::size_type size_type
enumrange< T >::Iterator begin(enumrange< T >)
FindFunctor(const FunctorType &rFunctor)
bool operator()(const value_type &rxValue)
ForEachFunctorWithIndex(FunctorType aFunctor)
void operator()(const value_type &rxValue)
ForEachFunctor(FunctorType aFunctor)
void operator()(const value_type &rxValue)