/** Returns a reference to the object with the passed index, or 0 on error. */
value_type get( sal_Int32 nIndex ) const
{ if( const value_type* pxRef = getRef( nIndex ) ) return *pxRef; return value_type();
}
/** Calls the passed functor for every contained object, automatically
skips all elements that are empty references. */ template< typename FunctorType > void forEach( FunctorType aFunctor ) const
{
std::for_each(this->begin(), this->end(), ForEachFunctor<FunctorType>(std::move(aFunctor)));
}
/** Calls the passed member function of ObjType on every contained object,
automatically skips all elements that are empty references. */ template< typename FuncType > void forEachMem( FuncType pFunc ) const
{
forEach( ::std::bind( pFunc, std::placeholders::_1 ) );
}
/** Calls the passed member function of ObjType on every contained object,
automatically skips all elements that are empty references. */ template< typename FuncType, typename ParamType > void forEachMem( FuncType pFunc, ParamType aParam ) const
{
forEach( ::std::bind( pFunc, std::placeholders::_1, aParam ) );
}
/** Calls the passed member function of ObjType on every contained object,
automatically skips all elements that are empty references. */ template< typename FuncType, typename ParamType1, typename ParamType2 > void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
{
forEach( ::std::bind( pFunc, std::placeholders::_1, aParam1, aParam2 ) );
}
/** Calls the passed member function of ObjType on every contained object,
automatically skips all elements that are empty references. */ template< typename FuncType, typename ParamType1, typename ParamType2, typename ParamType3 > void forEachMem( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2, ParamType3 aParam3 ) const
{
forEach( ::std::bind( pFunc, std::placeholders::_1, aParam1, aParam2, aParam3 ) );
}
/** Calls the passed functor for every contained object. Passes the index as
first argument and the object reference as second argument to rFunctor. */ template< typename FunctorType > void forEachWithIndex( const FunctorType& rFunctor ) const
{
::std::for_each( this->begin(), this->end(), ForEachFunctorWithIndex< FunctorType >( rFunctor ) );
}
/** Calls the passed member function of ObjType on every contained object.
Passes the vector index as first argument to the member function. */ template< typename FuncType, typename ParamType1, typename ParamType2 > void forEachMemWithIndex( FuncType pFunc, ParamType1 aParam1, ParamType2 aParam2 ) const
{
forEachWithIndex( ::std::bind( pFunc, std::placeholders::_2, std::placeholders::_1, aParam1, aParam2 ) );
}
/** Searches for an element by using the passed functor that takes a
constant reference of the object type (const ObjType&). */ template< typename FunctorType >
value_type findIf( const FunctorType& rFunctor ) const
{ typename container_type::const_iterator aIt = ::std::find_if( this->begin(), this->end(), FindFunctor< FunctorType >( rFunctor ) ); return (aIt == this->end()) ? value_type() : *aIt;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.