ThePEG::ObjectIndexer< IntT, ObjT > Class Template Reference

This is a templated class which dynamically associates (reference counted) objects to indices. More...

#include <ObjectIndexer.h>

List of all members.

Public Types

typedef ThePEG::Ptr< ObjT >
::pointer 
TPtr
 Alias for a reference counted pointer to ObjT .
typedef ThePEG::Ptr< ObjT >
::const_pointer 
cTPtr
 Alias for a reference counted pointer to a const ObjT .
typedef ThePEG::Ptr< ObjT >
::transient_pointer 
tTPtr
 Alias for a transient pointer to ObjT .
typedef ThePEG::Ptr< ObjT >
::transient_const_pointer 
tcTPtr
 Alias for a transient pointer to a const ObjT .
typedef map< IntT, tTPtrIndexObjectMap
 Map of objects to indices.
typedef map< TPtr, IntT > ObjectIndexMap
 Map of indices to objects.

Public Member Functions

IntT operator() (tTPtr o)
 Return the index for the given object.
tTPtr operator() (IntT i)
 Return the object for the given index.
tTPtr operator() (IntT i) const
 Return the object for the given index.
tTPtr find (IntT i) const
 Return the object for the given index.
void operator() (IntT i, tTPtr o)
 Associate the given object with the given index.
bool included (tTPtr o) const
 Return true if the given object is known.
bool included (IntT i) const
 Return true if the given index is known.
void clear ()
 Remove all associations.
bool empty () const
 Return true if no associations has been made.

Private Member Functions

ObjectIndexeroperator= (const ObjectIndexer &)
 Private and non-existent assignment operator.

Private Attributes

IndexObjectMap indexObject
 All known objects keyed by their indices.
ObjectIndexMap objectIndex
 All known indices keyed by the corresponding objects.


Detailed Description

template<typename IntT, typename ObjT>
class ThePEG::ObjectIndexer< IntT, ObjT >

This is a templated class which dynamically associates (reference counted) objects to indices.

Definition at line 22 of file ObjectIndexer.h.


Member Typedef Documentation

template<typename IntT, typename ObjT>
typedef ThePEG::Ptr< ObjT >::pointer ThePEG::ObjectIndexer< IntT, ObjT >::TPtr

Alias for a reference counted pointer to ObjT .

Definition at line 26 of file ObjectIndexer.h.

template<typename IntT, typename ObjT>
typedef ThePEG::Ptr< ObjT >::const_pointer ThePEG::ObjectIndexer< IntT, ObjT >::cTPtr

Alias for a reference counted pointer to a const ObjT .

Definition at line 26 of file ObjectIndexer.h.

template<typename IntT, typename ObjT>
typedef ThePEG::Ptr< ObjT >::transient_pointer ThePEG::ObjectIndexer< IntT, ObjT >::tTPtr

Alias for a transient pointer to ObjT .

Definition at line 26 of file ObjectIndexer.h.

template<typename IntT, typename ObjT>
typedef ThePEG::Ptr< ObjT >::transient_const_pointer ThePEG::ObjectIndexer< IntT, ObjT >::tcTPtr

Alias for a transient pointer to a const ObjT .

Definition at line 26 of file ObjectIndexer.h.

template<typename IntT, typename ObjT>
typedef map<TPtr,IntT> ThePEG::ObjectIndexer< IntT, ObjT >::ObjectIndexMap

Map of indices to objects.

Definition at line 32 of file ObjectIndexer.h.


Member Function Documentation

template<typename IntT, typename ObjT>
IntT ThePEG::ObjectIndexer< IntT, ObjT >::operator() ( tTPtr  o  )  [inline]

Return the index for the given object.

If the object is not known, a new index will be created.

Definition at line 40 of file ObjectIndexer.h.

template<typename IntT, typename ObjT>
tTPtr ThePEG::ObjectIndexer< IntT, ObjT >::operator() ( IntT  i  )  [inline]

Return the object for the given index.

If the index is not known, a new object will be (default) created.

Definition at line 56 of file ObjectIndexer.h.

template<typename IntT, typename ObjT>
tTPtr ThePEG::ObjectIndexer< IntT, ObjT >::operator() ( IntT  i  )  const [inline]

Return the object for the given index.

If the index is not known, a null pointer will be returned.

Definition at line 72 of file ObjectIndexer.h.

template<typename IntT, typename ObjT>
tTPtr ThePEG::ObjectIndexer< IntT, ObjT >::find ( IntT  i  )  const [inline]

Return the object for the given index.

If the index is not known, a null pointer will be returned.

Definition at line 80 of file ObjectIndexer.h.

Referenced by ThePEG::ObjectIndexer< long, ThePEG::ColourLine >::operator()().

template<typename IntT, typename ObjT>
void ThePEG::ObjectIndexer< IntT, ObjT >::operator() ( IntT  i,
tTPtr  o 
) [inline]

Associate the given object with the given index.

Possible other associations involving the index or the object is removed.

Definition at line 89 of file ObjectIndexer.h.


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

Generated on Thu Apr 29 12:43:25 2010 for ThePEG by  doxygen 1.5.5