The Gaudi Framework
master (0cbe8473)
Toggle main menu visibility
Loading...
Searching...
No Matches
TESSerializer.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 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
#pragma once
12
13
#include <
GaudiKernel/DataObject.h
>
14
#include <
GaudiKernel/IAddressCreator.h
>
15
#include <
GaudiKernel/IDataStoreAgent.h
>
16
17
// ROOT includes
18
#include <TClass.h>
19
20
// vector and string
21
#include <map>
22
#include <string>
23
#include <typeindex>
24
#include <vector>
25
26
// forward declarations
27
class
IDataProviderSvc
;
28
struct
IDataManagerSvc
;
29
class
TBufferFile;
30
class
DataStoreItem
;
31
class
IAddressCreator
;
32
39
40
namespace
GaudiMP
{
41
class
GAUDI_API
TESSerializer
:
virtual
public
IDataStoreAgent
{
42
typedef
std::vector<DataStoreItem*>
Items
;
43
typedef
std::vector<std::string>
ItemNames
;
44
typedef
std::vector<DataObject*>
Objects
;
45
46
public
:
48
TESSerializer
(
IDataProviderSvc
* svc,
IAddressCreator
* ac );
49
51
void
dumpBuffer
( TBufferFile& );
52
54
void
loadBuffer
( TBufferFile& );
55
57
void
addItem
(
const
std::string& path );
58
60
void
addOptItem
(
const
std::string& path );
61
63
bool
analyse
(
IRegistry
* dir,
int
level )
override
;
64
66
void
checkItems
();
67
68
virtual
~TESSerializer
() {}
69
70
protected
:
72
void
addItem( Items& itms,
const
std::string& descriptor );
73
75
DataStoreItem
* findItem(
const
std::string& path );
76
77
private
:
79
TClass*
getClass
(
DataObject
* obj ) {
80
auto
&
id
=
typeid
( *obj );
81
auto
pos =
m_classMap
.find(
id
);
82
if
( pos == end(
m_classMap
) ) {
return
m_classMap
[id] = TClass::GetClass(
id
); }
83
return
pos->second;
84
}
85
87
IDataProviderSvc
*
m_TES
;
89
IDataManagerSvc
*
m_TESMgr
;
91
ItemNames
m_itemNames
;
93
Items
m_itemList
;
95
ItemNames
m_optItemNames
;
97
Items
m_optItemList
;
99
DataStoreItem
*
m_currentItem
;
101
Objects
m_objects
;
102
104
std::map<std::type_index, TClass*>
m_classMap
;
106
bool
m_verifyItems
;
108
bool
m_strict
;
110
IAddressCreator
*
m_addressCreator
;
111
};
112
}
// namespace GaudiMP
DataObject.h
IAddressCreator.h
IDataStoreAgent.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition
DataObject.h:37
DataStoreItem
Description of the DataStoreItem class.
Definition
DataStoreItem.h:25
GaudiMP::TESSerializer::m_TESMgr
IDataManagerSvc * m_TESMgr
TES pointer.
Definition
TESSerializer.h:89
GaudiMP::TESSerializer::Items
std::vector< DataStoreItem * > Items
Definition
TESSerializer.h:42
GaudiMP::TESSerializer::m_objects
Objects m_objects
Selected list of Objects to be serialized (DataObject ptrs).
Definition
TESSerializer.h:101
GaudiMP::TESSerializer::analyse
bool analyse(IRegistry *dir, int level) override
Analysis callback.
Definition
TESSerializer.cpp:50
GaudiMP::TESSerializer::dumpBuffer
void dumpBuffer(TBufferFile &)
Dump TES contents listed in m_itemList/m_optItemList to a TBufferFile.
Definition
TESSerializer.cpp:70
GaudiMP::TESSerializer::m_classMap
std::map< std::type_index, TClass * > m_classMap
Map of gROOT class information.
Definition
TESSerializer.h:104
GaudiMP::TESSerializer::m_currentItem
DataStoreItem * m_currentItem
Current item while traversing the TES tree.
Definition
TESSerializer.h:99
GaudiMP::TESSerializer::checkItems
void checkItems()
print out the contents of m_itemList and m_optItemList (std::cout)
Definition
TESSerializer.cpp:360
GaudiMP::TESSerializer::getClass
TClass * getClass(DataObject *obj)
caching wrapper to TClass::GetClass
Definition
TESSerializer.h:79
GaudiMP::TESSerializer::m_verifyItems
bool m_verifyItems
Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.
Definition
TESSerializer.h:106
GaudiMP::TESSerializer::m_strict
bool m_strict
Boolean Flag used to determine error tolerance.
Definition
TESSerializer.h:108
GaudiMP::TESSerializer::m_itemNames
ItemNames m_itemNames
Vector of item names.
Definition
TESSerializer.h:91
GaudiMP::TESSerializer::ItemNames
std::vector< std::string > ItemNames
Definition
TESSerializer.h:43
GaudiMP::TESSerializer::~TESSerializer
virtual ~TESSerializer()
Definition
TESSerializer.h:68
GaudiMP::TESSerializer::TESSerializer
TESSerializer(IDataProviderSvc *svc, IAddressCreator *ac)
Constructor.
Definition
TESSerializer.cpp:61
GaudiMP::TESSerializer::m_optItemNames
ItemNames m_optItemNames
Vector of item names (std::strings).
Definition
TESSerializer.h:95
GaudiMP::TESSerializer::addOptItem
void addOptItem(const std::string &path)
add an item to the TESSerializer's optional list (notation)
Definition
TESSerializer.cpp:354
GaudiMP::TESSerializer::m_addressCreator
IAddressCreator * m_addressCreator
IAddress Creator for Opaque Addresses.
Definition
TESSerializer.h:110
GaudiMP::TESSerializer::addItem
void addItem(const std::string &path)
add an item to the TESSerializer's list (notation)
Definition
TESSerializer.cpp:348
GaudiMP::TESSerializer::loadBuffer
void loadBuffer(TBufferFile &)
Rebuild TES from items in a TBufferFile.
Definition
TESSerializer.cpp:169
GaudiMP::TESSerializer::Objects
std::vector< DataObject * > Objects
Definition
TESSerializer.h:44
GaudiMP::TESSerializer::m_TES
IDataProviderSvc * m_TES
TES pointer.
Definition
TESSerializer.h:87
GaudiMP::TESSerializer::m_itemList
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs).
Definition
TESSerializer.h:93
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs).
Definition
TESSerializer.h:97
IAddressCreator
IAddressCreator interface definition.
Definition
IAddressCreator.h:33
IDataProviderSvc
Data provider interface definition.
Definition
IDataProviderSvc.h:48
IDataStoreAgent
Generic data agent interface.
Definition
IDataStoreAgent.h:24
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition
IRegistry.h:29
GaudiMP
A class to serialize/deserialize TES objects to and from a TBufferFile Author: P.
Definition
TESSerializer.h:40
IDataManagerSvc
Definition
IDataManagerSvc.h:47
GaudiMP
include
GaudiMP
TESSerializer.h
Generated on
for The Gaudi Framework by
1.17.0