CMS 3D CMS Logo

ClassID< T > Class Template Reference

Manager that issues ID to any class [registration]. More...

#include <CalibTracker/SiStripRunSummary/interface/ClassID.h>

Inheritance diagram for ClassID< T >:

ClassIDBase

List of all members.

Static Public Member Functions

static ID get ()
 Get Class ID [all classes (same ones) will have the same ID] [Note: issued ID is runtime dependent - first to call registration will first to get id.

Static Private Attributes

static ID nID_ = ClassID<T>::nINIT_CLASS_ID_


Detailed Description

template<class T>
class ClassID< T >

Manager that issues ID to any class [registration].

Implemented as a template in order to achieve desired effect: once Manager is called to issue ID for some class compiler will generate appropriate class.

Definition at line 20 of file ClassID.h.


Member Function Documentation

template<class T>
int ClassID< T >::get ( void   )  [inline, static]

Get Class ID [all classes (same ones) will have the same ID] [Note: issued ID is runtime dependent - first to call registration will first to get id.

For example map of objects where keys are IDs can not be saved and later read with assumption that classes stored will have the same IDs except situations when classes are registered in exactly the same sequence]

Returns:
ClassIDBase::ID that represent ID

Definition at line 45 of file ClassID.h.

References ClassID< T >::nID_, ClassIDBase::nINIT_CLASS_ID_, and ClassIDBase::nLastClassID_.

Referenced by FlagXML::createChild(), FlagTxt::createChild(), FlagXML::getChild(), FlagTxt::getChild(), FlagXML::getChildren(), FlagTxt::getChildren(), TIBFlagXML::getID(), DQMFlagXML::getID(), TIBFlagTxt::getID(), TriggerFlagXML::getID(), GlobalFlagXML::getID(), TIDFlagTxt::getID(), DQMFlagTxt::getID(), TECFlagTxt::getID(), DCSFlagTxt::getID(), DAQFlagTxt::getID(), TriggerFlagTxt::getID(), GlobalFlagTxt::getID(), TOBFlagXML::getID(), DAQFlagXML::getID(), DCSFlagXML::getID(), TECFlagXML::getID(), TIDFlagXML::getID(), and TOBFlagTxt::getID().

00045                       {
00046     // Check if class was registered
00047     if( nINIT_CLASS_ID_ == nID_) {
00048       // Class is not Registered: register it 
00049       nID_ = ++nLastClassID_;
00050     }
00051 
00052     return nID_;
00053   }


Member Data Documentation

template<class T>
ClassIDBase::ID ClassID< T >::nID_ = ClassID<T>::nINIT_CLASS_ID_ [inline, static, private]

Definition at line 37 of file ClassID.h.

Referenced by ClassID< T >::get().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:16:20 2009 for CMSSW by  doxygen 1.5.4