The Gaudi Framework  v32r2 (46d42edc)
TESSerializer.h
Go to the documentation of this file.
1 #ifndef GAUDIMP_TESSERIALIZER_H
2 #define GAUDIMP_TESSERIALIZER_H
3 
7 
8 // ROOT includes
9 #include "TClass.h"
10 
11 // vector and string
12 #include <map>
13 #include <string>
14 #include <typeindex>
15 #include <vector>
16 
17 // forward declarations
18 class IDataProviderSvc;
19 struct IDataManagerSvc;
20 class TBufferFile;
21 class DataStoreItem;
22 class IAddressCreator;
23 
31 namespace GaudiMP {
32  class GAUDI_API TESSerializer : virtual public IDataStoreAgent {
36 
37  public:
40 
42  void dumpBuffer( TBufferFile& );
43 
45  void loadBuffer( TBufferFile& );
46 
48  void addItem( const std::string& path );
49 
51  void addOptItem( const std::string& path );
52 
54  bool analyse( IRegistry* dir, int level ) override;
55 
57  void checkItems();
58 
59  virtual ~TESSerializer() {}
60 
61  protected:
63  void addItem( Items& itms, const std::string& descriptor );
64 
66  DataStoreItem* findItem( const std::string& path );
67 
68  private:
70  TClass* getClass( DataObject* obj ) {
71  auto& id = typeid( *obj );
72  auto pos = m_classMap.find( id );
73  if ( pos == end( m_classMap ) ) { return m_classMap[id] = TClass::GetClass( id ); }
74  return pos->second;
75  }
76 
93 
99  bool m_strict;
102  };
103 } // namespace GaudiMP
104 #endif
A class to serialize/deserialize TES objects to and from a TBufferFile Author: P.
Definition: PyROOTPickle.h:31
IAddressCreator interface definition.
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:88
ItemNames m_optItemNames
Vector of item names (std::strings)
Definition: TESSerializer.h:86
bool m_verifyItems
Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.
Definition: TESSerializer.h:97
Data provider interface definition.
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
IAddressCreator * m_addressCreator
IAddress Creator for Opaque Addresses.
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:84
bool m_strict
Boolean Flag used to determine error tolerance.
Definition: TESSerializer.h:99
STL class.
std::map< std::type_index, TClass * > m_classMap
Map of gROOT class information.
Definition: TESSerializer.h:95
std::vector< DataStoreItem * > Items
Definition: TESSerializer.h:33
IDataManagerSvc * m_TESMgr
TES pointer.
Definition: TESSerializer.h:80
TClass * getClass(DataObject *obj)
caching wrapper to TClass::GetClass
Definition: TESSerializer.h:70
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
std::vector< DataObject * > Objects
Definition: TESSerializer.h:35
def end
Definition: IOTest.py:113
ItemNames m_itemNames
Vector of item names.
Definition: TESSerializer.h:82
Generic data agent interface.
Objects m_objects
Selected list of Objects to be serialized (DataObject ptrs)
Definition: TESSerializer.h:92
std::vector< std::string > ItemNames
Definition: TESSerializer.h:34
DataStoreItem * m_currentItem
Current item while traversing the TES tree.
Definition: TESSerializer.h:90
#define GAUDI_API
Definition: Kernel.h:71
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
IDataProviderSvc * m_TES
TES pointer.
Definition: TESSerializer.h:78