3 #ifndef GAUDIALG_TUPLEPUT_H
4 #define GAUDIALG_TUPLEPUT_H 1
37 template <
class VALUE>
51 {
if ( 0 != ientry->second ) {
delete ientry->second ; } }
61 if (
m_map.
end() != ifound ) {
return ifound->second ; }
63 if ( 0 == tuple ) {
return 0 ; }
67 tuple -> Error (
"ItemStore::getItem('" + key
68 +
"') item name is not unique").ignore() ;
75 tuple -> Error (
"ItemStore::getItem('" + key
76 +
"') invalid NTuple::Tuple*" ).ignore() ;
85 tuple -> Error (
"ItemStore::getItem('" + key
86 +
"') cannot addItem" , sc ).ignore() ;
92 tuple -> Warning (
"ItemStore::getItem('" + key
93 +
"') the item not unique " ).ignore() ;
96 if ( !
m_map.
insert ( std::make_pair ( key , item ) ).second )
98 tuple -> Warning (
"ItemStore::getItem('" + key
99 +
"') item is not inserted!" ).ignore() ;
125 template <
class TYPE>
127 (
const std::string& name ,
const TYPE* obj )
133 static bool s_fail = false ;
134 static TClass* s_type = 0 ;
139 s_type = TClass::GetClass(
typeid(TYPE));
152 {
return Error (
" put('" + name +
"'): invalid item detected",
InvalidItem ) ; }
154 (*item) =
const_cast<TYPE*
> ( obj ) ;
163 #endif // GAUDIALG_TUPLEPUT_H
~ItemStore()
destructor : delete all known entries
bool goodItem(const std::string &name) const
check the uniqueness of the name
Header file for class TupleObj.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
std::pair< iterator, bool > insert(const value_type &val)
ItemStore & operator=(const ItemStore &)
no assignment is allowed
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
This class is used for returning status codes from appropriate routines.
Store m_map
the underlying map
iterator find(const key_type &key)
Abstract base class which allows the user to interact with the actual N tuple implementation.
bool addItem(const std::string &name, const std::string &type)
add the item name into the list of known items
map_type::iterator iterator
GaudiUtils::HashMap< std::string, NTuple::Item< VALUE > * > Store
Common class providing an architecture-independent hash map.
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Simple class, which represents the local storage of N-tuple items of the given type.
Class acting as a smart pointer holding a N tuple _Item.
StatusCode put(const std::string &name, const TYPE *obj)
The function allows to add almost arbitrary object into N-tuple.
NTuple::Item< VALUE > * getItem(const std::string &key, Tuples::TupleObj *tuple)
the only one method:
ItemStore()
constructor : create empty map