The Gaudi Framework  master (37c0b60a)
TESSerializer.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIMP_TESSERIALIZER_H
12 #define GAUDIMP_TESSERIALIZER_H
13 
14 #include <GaudiKernel/DataObject.h>
17 
18 // ROOT includes
19 #include <TClass.h>
20 
21 // vector and string
22 #include <map>
23 #include <string>
24 #include <typeindex>
25 #include <vector>
26 
27 // forward declarations
28 class IDataProviderSvc;
29 struct IDataManagerSvc;
30 class TBufferFile;
31 class DataStoreItem;
32 class IAddressCreator;
33 
41 namespace GaudiMP {
42  class GAUDI_API TESSerializer : virtual public IDataStoreAgent {
46 
47  public:
50 
52  void dumpBuffer( TBufferFile& );
53 
55  void loadBuffer( TBufferFile& );
56 
58  void addItem( const std::string& path );
59 
61  void addOptItem( const std::string& path );
62 
64  bool analyse( IRegistry* dir, int level ) override;
65 
67  void checkItems();
68 
69  virtual ~TESSerializer() {}
70 
71  protected:
73  void addItem( Items& itms, const std::string& descriptor );
74 
76  DataStoreItem* findItem( const std::string& path );
77 
78  private:
80  TClass* getClass( DataObject* obj ) {
81  auto& id = typeid( *obj );
82  auto pos = m_classMap.find( id );
83  if ( pos == end( m_classMap ) ) { return m_classMap[id] = TClass::GetClass( id ); }
84  return pos->second;
85  }
86 
103 
109  bool m_strict;
112  };
113 } // namespace GaudiMP
114 #endif
IAddressCreator
Definition: IAddressCreator.h:38
std::string
STL class.
IDataManagerSvc
Definition: IDataManagerSvc.h:55
AtlasMCRecoFullPrecedenceDump.path
path
Definition: AtlasMCRecoFullPrecedenceDump.py:49
GaudiMP::TESSerializer::m_itemNames
ItemNames m_itemNames
Vector of item names.
Definition: TESSerializer.h:92
std::vector< DataStoreItem * >
IAddressCreator.h
GaudiMP::TESSerializer::m_currentItem
DataStoreItem * m_currentItem
Current item while traversing the TES tree.
Definition: TESSerializer.h:100
GaudiMP::TESSerializer::m_TESMgr
IDataManagerSvc * m_TESMgr
TES pointer.
Definition: TESSerializer.h:90
IRegistry
Definition: IRegistry.h:32
GaudiPartProp.tests.id
id
Definition: tests.py:111
GaudiMP::TESSerializer::m_TES
IDataProviderSvc * m_TES
TES pointer.
Definition: TESSerializer.h:88
GaudiMP::TESSerializer::ItemNames
std::vector< std::string > ItemNames
Definition: TESSerializer.h:44
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:98
GaudiMP::TESSerializer::m_classMap
std::map< std::type_index, TClass * > m_classMap
Map of gROOT class information.
Definition: TESSerializer.h:105
GaudiMP::TESSerializer::Items
std::vector< DataStoreItem * > Items
Definition: TESSerializer.h:43
DataStoreItem
Definition: DataStoreItem.h:27
GaudiMP::TESSerializer
Definition: TESSerializer.h:42
GaudiMP::TESSerializer::m_verifyItems
bool m_verifyItems
Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.
Definition: TESSerializer.h:107
GaudiMP::TESSerializer::getClass
TClass * getClass(DataObject *obj)
caching wrapper to TClass::GetClass
Definition: TESSerializer.h:80
GaudiPartProp.decorators.Items
Items
Definition: decorators.py:304
std::map< std::type_index, TClass * >
gaudirun.level
level
Definition: gaudirun.py:364
GaudiMP::TESSerializer::m_addressCreator
IAddressCreator * m_addressCreator
IAddress Creator for Opaque Addresses.
Definition: TESSerializer.h:111
DataObject.h
GaudiMP::TESSerializer::m_objects
Objects m_objects
Selected list of Objects to be serialized (DataObject ptrs)
Definition: TESSerializer.h:102
GaudiMP::TESSerializer::Objects
std::vector< DataObject * > Objects
Definition: TESSerializer.h:45
DataObject
Definition: DataObject.h:36
GaudiMP::TESSerializer::m_itemList
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:94
GaudiMP::TESSerializer::m_optItemNames
ItemNames m_optItemNames
Vector of item names (std::strings)
Definition: TESSerializer.h:96
IDataProviderSvc
Definition: IDataProviderSvc.h:53
IOTest.end
end
Definition: IOTest.py:125
IDataStoreAgent.h
GaudiMP::TESSerializer::~TESSerializer
virtual ~TESSerializer()
Definition: TESSerializer.h:69
GaudiMP::TESSerializer::m_strict
bool m_strict
Boolean Flag used to determine error tolerance.
Definition: TESSerializer.h:109
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81
GaudiMP
A class to serialize/deserialize TES objects to and from a TBufferFile Author: P.
Definition: PyROOTPickle.h:41
IDataStoreAgent
Definition: IDataStoreAgent.h:27