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

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

#include <refmap.hxx>

Inheritance diagram for oox::RefMap< KeyType, ObjType, CompType >:
[legend]
Collaboration diagram for oox::RefMap< KeyType, ObjType, CompType >:
[legend]

Classes

struct  ForEachFunctor
 
struct  ForEachFunctorWithKey
 

Public Types

typedef std::map< KeyType, std::shared_ptr< ObjType >, CompType > container_type
 
typedef container_type::key_type key_type
 
typedef container_type::mapped_type mapped_type
 
typedef container_type::value_type value_type
 
typedef container_type::key_compare key_compare
 

Public Member Functions

bool has (key_type nKey) const
 Returns true, if the object associated to the passed key exists. More...
 
mapped_type get (key_type nKey) const
 Returns a reference to the object associated to the passed key, or an empty reference on error. More...
 
template<typename FunctorType >
void forEach (const FunctorType &rFunctor) 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 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 forEachWithKey (const FunctorType &rFunctor) const
 Calls the passed functor for every contained object. More...
 
template<typename FuncType >
void forEachMemWithKey (FuncType pFunc) const
 Calls the passed member function of ObjType on every contained object. More...
 

Private Member Functions

const mapped_typegetRef (key_type nKey) const
 

Detailed Description

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
class oox::RefMap< KeyType, ObjType, CompType >

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

An instance of the class RefMap< Type > stores elements of the type std::shared_ptr< Type >. The new accessor functions has() and get() work correctly for nonexisting keys, there is no need to check the passed key before.

Definition at line 39 of file refmap.hxx.

Member Typedef Documentation

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
typedef std::map< KeyType, std::shared_ptr< ObjType >, CompType > oox::RefMap< KeyType, ObjType, CompType >::container_type

Definition at line 42 of file refmap.hxx.

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
typedef container_type::key_compare oox::RefMap< KeyType, ObjType, CompType >::key_compare

Definition at line 46 of file refmap.hxx.

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
typedef container_type::key_type oox::RefMap< KeyType, ObjType, CompType >::key_type

Definition at line 43 of file refmap.hxx.

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
typedef container_type::mapped_type oox::RefMap< KeyType, ObjType, CompType >::mapped_type

Definition at line 44 of file refmap.hxx.

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
typedef container_type::value_type oox::RefMap< KeyType, ObjType, CompType >::value_type

Definition at line 45 of file refmap.hxx.

Member Function Documentation

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
template<typename FunctorType >
void oox::RefMap< KeyType, ObjType, CompType >::forEach ( const FunctorType &  rFunctor) const
inline

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

Definition at line 68 of file refmap.hxx.

Referenced by oox::RefMap< KeyType, ModelType >::forEachMem().

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
template<typename FuncType >
void oox::RefMap< KeyType, ObjType, CompType >::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 76 of file refmap.hxx.

Referenced by oox::ole::VbaProject::importModulesAndForms().

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
template<typename FuncType , typename ParamType1 , typename ParamType2 >
void oox::RefMap< KeyType, ObjType, CompType >::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 refmap.hxx.

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
template<typename FuncType , typename ParamType1 , typename ParamType2 , typename ParamType3 >
void oox::RefMap< KeyType, ObjType, CompType >::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 refmap.hxx.

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
template<typename FuncType >
void oox::RefMap< KeyType, ObjType, CompType >::forEachMemWithKey ( FuncType  pFunc) const
inline

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

Passes the object key as argument to the member function.

Definition at line 109 of file refmap.hxx.

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
template<typename FunctorType >
void oox::RefMap< KeyType, ObjType, CompType >::forEachWithKey ( const FunctorType &  rFunctor) const
inline

Calls the passed functor for every contained object.

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

Definition at line 101 of file refmap.hxx.

Referenced by oox::RefMap< KeyType, ModelType >::forEachMemWithKey().

template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
mapped_type oox::RefMap< KeyType, ObjType, CompType >::get ( key_type  nKey) const
inline
template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
const mapped_type* oox::RefMap< KeyType, ObjType, CompType >::getRef ( key_type  nKey) const
inlineprivate
template<typename KeyType, typename ObjType, typename CompType = std::less< KeyType >>
bool oox::RefMap< KeyType, ObjType, CompType >::has ( key_type  nKey) const
inline

Returns true, if the object associated to the passed key exists.

Returns false, if the key exists but points to an empty reference.

Definition at line 51 of file refmap.hxx.

Referenced by oox::drawingml::chart::TypeGroupConverter::createCategorySequence(), oox::drawingml::chart::ObjectFormatterData::getTypeFormatter(), oox::ole::VbaProject::importModulesAndForms(), oox::drawingml::chart::SeriesContextBase::onCreateContext(), and oox::ole::VbaProject::readVbaModules().


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