|
Gaudi Framework, version v21r6 |
| Home | Generated: 11 Nov 2009 |
#include <GaudiAlg/TuplePut.h>

Essentially it is a restricted GaudiUtils::HashMap with the ownership of the newly created entries
Definition at line 38 of file TuplePut.h.
Public Member Functions | |
| ItemStore () | |
| constructor : create empty map | |
| ~ItemStore () | |
| destructor : delete all known entries | |
Protected Member Functions | |
| NTuple::Item< VALUE > * | getItem (const std::string &key, Tuples::TupleObj *tuple) |
| the only one method: | |
Private Types | |
| typedef GaudiUtils::HashMap < std::string, NTuple::Item < VALUE > * > | Store |
Private Member Functions | |
| ItemStore (const ItemStore &) | |
| no copy is allowed | |
| ItemStore & | operator= (const ItemStore &) |
| no assignment is allowed | |
Private Attributes | |
| Store | m_map |
| the underlying map | |
Friends | |
| class | TupleObj |
typedef GaudiUtils::HashMap<std::string,NTuple::Item<VALUE>*> Tuples::ItemStore< VALUE >::Store [private] |
Definition at line 42 of file TuplePut.h.
| Tuples::ItemStore< VALUE >::ItemStore | ( | ) | [inline] |
| Tuples::ItemStore< VALUE >::~ItemStore | ( | ) | [inline] |
destructor : delete all known entries
Definition at line 47 of file TuplePut.h.
00048 { 00049 for ( typename Store::iterator ientry = m_map.begin() ; 00050 m_map.end() != ientry ; ++ientry ) 00051 { if ( 0 != ientry->second ) { delete ientry->second ; } } 00052 }
| Tuples::ItemStore< VALUE >::ItemStore | ( | const ItemStore< VALUE > & | ) | [private] |
no copy is allowed
| NTuple::Item<VALUE>* Tuples::ItemStore< VALUE >::getItem | ( | const std::string & | key, | |
| Tuples::TupleObj * | tuple | |||
| ) | [inline, protected] |
the only one method:
Definition at line 56 of file TuplePut.h.
00057 { 00058 // find the item by name 00059 typename Store::iterator ifound = m_map.find( key ) ; 00060 // existing item? 00061 if ( m_map.end() != ifound ) { return ifound->second ; } // RETURN 00062 // check the tuple for booking: 00063 if ( 0 == tuple ) { return 0 ; } 00064 // check the existence of the name 00065 if ( !tuple->goodItem ( key ) ) 00066 { 00067 tuple -> Error ( "ItemStore::getItem('" + key 00068 + "') item name is not unique").ignore() ; 00069 return 0 ; // RETURN 00070 } 00071 // get the underlying object 00072 NTuple::Tuple* tup = tuple->tuple() ; 00073 if ( 0 == tup ) 00074 { 00075 tuple -> Error ( "ItemStore::getItem('" + key 00076 + "') invalid NTuple::Tuple*" ).ignore() ; 00077 return 0 ; // RETURN 00078 } 00079 // create new item: 00080 NTuple::Item<VALUE>* item = new NTuple::Item<VALUE>() ; 00081 // add it into N-tuple 00082 StatusCode sc = tup->addItem( key , *item ) ; // ATTENTION! 00083 if ( sc.isFailure() ) 00084 { 00085 tuple -> Error ( "ItemStore::getItem('" + key 00086 + "') cannot addItem" , sc ).ignore() ; 00087 return 0 ; // RETURN 00088 } 00089 // check the name again 00090 if ( !tuple->addItem( key , System::typeinfoName ( typeid ( VALUE ) ) ) ) 00091 { 00092 tuple -> Warning ( "ItemStore::getItem('" + key 00093 + "') the item not unique " ).ignore() ; 00094 } 00095 // add the newly created item into the store: 00096 if ( !m_map.insert ( std::make_pair ( key , item ) ).second ) 00097 { 00098 tuple -> Warning ( "ItemStore::getItem('" + key 00099 + "') item is not inserted!" ).ignore() ; 00100 } 00101 // 00102 return item ; // RETURN 00103 }
| ItemStore& Tuples::ItemStore< VALUE >::operator= | ( | const ItemStore< VALUE > & | ) | [private] |
no assignment is allowed
Definition at line 40 of file TuplePut.h.
Store Tuples::ItemStore< VALUE >::m_map [private] |