#include <TrkFitTypeKey.h>
Public Member Functions | |
TrkFitTypeKey (const char *name=0, const PdtPid::PidType pid=PdtPid::null) | |
TrkFitTypeKey (const TrkFitTypeKey &) | |
TrkFitTypeKey (const int &) | |
virtual | ~TrkFitTypeKey () |
bool | operator== (const TrkFitTypeKey &rhs) const |
bool | operator< (const TrkFitTypeKey &rhs) const |
TrkFitTypeKey & | operator= (const TrkFitTypeKey &rhs) |
const int & | value () const |
const IfdKey * | ifdKey () const |
PdtPid::PidType | pidType () const |
void | printAll (std::ostream &os=std::cout) const |
Static Public Member Functions | |
static int | currentKey () |
static void | killFitType (const TrkFitTypeKey key) |
Static Protected Member Functions | |
static int | newFitType (const char *name=0) |
Private Attributes | |
int | _value |
Static Private Attributes | |
static std::vector< IfdKey * > | _keys |
static std::vector< PdtPid::PidType > | _pidTypes |
static const int | _defaultValue |
Definition at line 31 of file TrkFitTypeKey.h.
TrkFitTypeKey::TrkFitTypeKey | ( | const char * | name = 0 , |
|
const PdtPid::PidType | pid = PdtPid::null | |||
) |
Definition at line 86 of file TrkFitTypeKey.cxx.
References _pidTypes, and _value.
00088 :_value(newFitType(name)) 00089 { 00090 if ( _value >= 0 ) _pidTypes.push_back(pid); 00091 }
TrkFitTypeKey::TrkFitTypeKey | ( | const TrkFitTypeKey & | ) |
TrkFitTypeKey::TrkFitTypeKey | ( | const int & | ) |
TrkFitTypeKey::~TrkFitTypeKey | ( | ) | [virtual] |
static int TrkFitTypeKey::currentKey | ( | ) | [inline, static] |
Definition at line 39 of file TrkFitTypeKey.h.
References _keys.
Referenced by ifdKey(), killFitType(), newFitType(), and pidType().
00039 { return _keys.size(); }
const IfdKey* TrkFitTypeKey::ifdKey | ( | ) | const [inline] |
Definition at line 85 of file TrkFitTypeKey.h.
References _keys, _value, and currentKey().
00085 { 00086 if ( _value < 0 || _value >= currentKey() ) return 0; 00087 return _keys[_value]; 00088 }
void TrkFitTypeKey::killFitType | ( | const TrkFitTypeKey | key | ) | [static] |
Definition at line 72 of file TrkFitTypeKey.cxx.
References _keys, currentKey(), genRecEmupikp::i, and key.
00073 { 00074 const int i = key.value(); 00075 if ( i < 0 || i >= currentKey() ) return; 00076 IfdKey* theKey = _keys[i]; 00077 assert(theKey != 0 ); 00078 delete theKey; 00079 theKey = 0; 00080 }
int TrkFitTypeKey::newFitType | ( | const char * | name = 0 |
) | [static, protected] |
Definition at line 64 of file TrkFitTypeKey.cxx.
References _defaultValue, _keys, and currentKey().
00065 { 00066 if ( name == 0 ) return _defaultValue; 00067 _keys.push_back( new IfdStrKey(name) ); 00068 return (currentKey()-1); 00069 }
bool TrkFitTypeKey::operator< | ( | const TrkFitTypeKey & | rhs | ) | const [inline] |
TrkFitTypeKey& TrkFitTypeKey::operator= | ( | const TrkFitTypeKey & | rhs | ) | [inline] |
bool TrkFitTypeKey::operator== | ( | const TrkFitTypeKey & | rhs | ) | const [inline] |
PdtPid::PidType TrkFitTypeKey::pidType | ( | ) | const [inline] |
Definition at line 90 of file TrkFitTypeKey.h.
References _pidTypes, _value, currentKey(), and PdtPid::null.
00090 { 00091 if ( _value < 0 || _value >= currentKey() ) return PdtPid::null; 00092 return _pidTypes[_value]; 00093 }
void TrkFitTypeKey::printAll | ( | std::ostream & | os = std::cout |
) | const |
const int& TrkFitTypeKey::value | ( | ) | const [inline] |
Definition at line 83 of file TrkFitTypeKey.h.
References _value.
Referenced by operator<(), operator=(), and operator==().
00083 { return _value; }
const int TrkFitTypeKey::_defaultValue [static, private] |
std::vector< IfdKey * > TrkFitTypeKey::_keys [static, private] |
Definition at line 49 of file TrkFitTypeKey.h.
Referenced by currentKey(), ifdKey(), killFitType(), and newFitType().
std::vector< PdtPid::PidType > TrkFitTypeKey::_pidTypes [static, private] |
int TrkFitTypeKey::_value [private] |
Definition at line 100 of file TrkFitTypeKey.h.
Referenced by ifdKey(), operator<(), operator=(), operator==(), pidType(), TrkFitTypeKey(), and value().