LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id > Class Template Reference

storage for double access: from object to id and from id to object : id must be integer. More...

#include <common/misc/DoubleAccessObjectToIdMap.h>

Public Types

typedef std::map< const Object *, Id, CompareObjectPtr< Object > > AccessMap
typedef std::vector< const Object * > ReverseAccessMap

Public Member Functions

 DoubleAccessObjectToIdMap ()
virtual ~DoubleAccessObjectToIdMap ()
Id insert (const Object &)
 insert an object if not already inserted
const AccessMap & getAccessMap () const
const ReverseAccessMap & getReverseAccessMap () const
const Object & get (const Id &) const
const Id & get (const Object &) const
bool hasId (const Id &) const
bool hasValue (const Object &) const
Id & operator[] (const Object &)
Object & operator[] (const Id &)

Detailed Description

template<typename Object, typename Id>
class Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >

storage for double access: from object to id and from id to object : id must be integer.

Objects and ids cannot be of the same type

Author
Romaric Besancon (romar.nosp@m.ic.b.nosp@m.esanc.nosp@m.on@c.nosp@m.ea.fr)
Date
Mon Jan 22 2007

Definition at line 37 of file DoubleAccessObjectToIdMap.h.

Member Typedef Documentation

◆ AccessMap

template<typename Object, typename Id>
typedef std::map<const Object*,Id,CompareObjectPtr<Object> > Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::AccessMap

Definition at line 40 of file DoubleAccessObjectToIdMap.h.

◆ ReverseAccessMap

template<typename Object, typename Id>
typedef std::vector<const Object*> Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::ReverseAccessMap

Definition at line 41 of file DoubleAccessObjectToIdMap.h.

Constructor & Destructor Documentation

◆ DoubleAccessObjectToIdMap()

template<typename Object, typename Id>
Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::DoubleAccessObjectToIdMap ( )

Definition at line 16 of file DoubleAccessObjectToIdMap.h.

◆ ~DoubleAccessObjectToIdMap()

template<typename Object, typename Id>
Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::~DoubleAccessObjectToIdMap ( )
virtual

Definition at line 25 of file DoubleAccessObjectToIdMap.h.

Member Function Documentation

◆ get() [1/2]

template<typename Object, typename Id>
const Object & Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::get ( const Id & id) const

get accessors do not try to insert object if not found: throw an exception

Returns

Definition at line 71 of file DoubleAccessObjectToIdMap.h.

◆ get() [2/2]

template<typename Object, typename Id>
const Id & Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::get ( const Object & val) const

Definition at line 42 of file DoubleAccessObjectToIdMap.h.

◆ getAccessMap()

template<typename Object, typename Id>
const AccessMap & Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::getAccessMap ( ) const
inline

Definition at line 79 of file DoubleAccessObjectToIdMap.h.

◆ getReverseAccessMap()

template<typename Object, typename Id>
const ReverseAccessMap & Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::getReverseAccessMap ( ) const
inline

Definition at line 81 of file DoubleAccessObjectToIdMap.h.

◆ hasId()

template<typename Object, typename Id>
bool Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::hasId ( const Id & id) const

just check the existence of key or value in the access map

Returns

Definition at line 62 of file DoubleAccessObjectToIdMap.h.

◆ hasValue()

template<typename Object, typename Id>
bool Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::hasValue ( const Object & val) const

Definition at line 55 of file DoubleAccessObjectToIdMap.h.

◆ insert()

template<typename Object, typename Id>
Id Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::insert ( const Object & val)

insert an object if not already inserted

Definition at line 84 of file DoubleAccessObjectToIdMap.h.

◆ operator[]() [1/2]

template<typename Object, typename Id>
Object & Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::operator[] ( const Id & id)

Definition at line 137 of file DoubleAccessObjectToIdMap.h.

◆ operator[]() [2/2]

template<typename Object, typename Id>
Id & Lima::Common::Misc::DoubleAccessObjectToIdMap< Object, Id >::operator[] ( const Object & val)

double access [] operators

Definition at line 93 of file DoubleAccessObjectToIdMap.h.


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