|
Gaudi Framework, version v23r0 |
| Home | Generated: Mon Jan 30 2012 |
Simple class, which represents the local storage of N-tuple items of the given type. More...
#include <GaudiAlg/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 |
Friends | |
| class | TupleObj |
Simple class, which represents the local storage of N-tuple items of the given type.
Essentially it is a restricted GaudiUtils::HashMap with the ownership of the newly created entries
Definition at line 38 of file TuplePut.h.
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.
{
for ( typename Store::iterator ientry = m_map.begin() ;
m_map.end() != ientry ; ++ientry )
{ if ( 0 != ientry->second ) { delete ientry->second ; } }
}
| 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.
{
// find the item by name
typename Store::iterator ifound = m_map.find( key ) ;
// existing item?
if ( m_map.end() != ifound ) { return ifound->second ; } // RETURN
// check the tuple for booking:
if ( 0 == tuple ) { return 0 ; }
// check the existence of the name
if ( !tuple->goodItem ( key ) )
{
tuple -> Error ( "ItemStore::getItem('" + key
+ "') item name is not unique").ignore() ;
return 0 ; // RETURN
}
// get the underlying object
NTuple::Tuple* tup = tuple->tuple() ;
if ( 0 == tup )
{
tuple -> Error ( "ItemStore::getItem('" + key
+ "') invalid NTuple::Tuple*" ).ignore() ;
return 0 ; // RETURN
}
// create new item:
NTuple::Item<VALUE>* item = new NTuple::Item<VALUE>() ;
// add it into N-tuple
StatusCode sc = tup->addItem( key , *item ) ; // ATTENTION!
if ( sc.isFailure() )
{
tuple -> Error ( "ItemStore::getItem('" + key
+ "') cannot addItem" , sc ).ignore() ;
return 0 ; // RETURN
}
// check the name again
if ( !tuple->addItem( key , System::typeinfoName ( typeid ( VALUE ) ) ) )
{
tuple -> Warning ( "ItemStore::getItem('" + key
+ "') the item not unique " ).ignore() ;
}
// add the newly created item into the store:
if ( !m_map.insert ( std::make_pair ( key , item ) ).second )
{
tuple -> Warning ( "ItemStore::getItem('" + key
+ "') item is not inserted!" ).ignore() ;
}
//
return item ; // RETURN
}
| ItemStore& Tuples::ItemStore< VALUE >::operator= | ( | const ItemStore< VALUE > & | ) | [private] |
no assignment is allowed
friend class TupleObj [friend] |
Definition at line 40 of file TuplePut.h.
Store Tuples::ItemStore< VALUE >::m_map [private] |
the underlying map
Definition at line 111 of file TuplePut.h.