| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Protected Member Functions | Private Types | Private Attributes | List of all members
GaudiMP::TESSerializer Class Reference

`#include <GaudiMP/TESSerializer.h>`

Inheritance diagram for GaudiMP::TESSerializer:
[legend]
Collaboration diagram for GaudiMP::TESSerializer:
[legend]

## Public Member Functions
| TESSerializer (IDataProviderSvc *svc, IAddressCreator *ac)
| Constructor. More...
void | dumpBuffer (TBufferFile &)
| Dump TES contents listed in m_itemList/m_optItemList to a TBufferFile. More...
void | loadBuffer (TBufferFile &)
| Rebuild TES from items in a TBufferFile. More...
void | addItem (const std::string &path)
| add an item to the TESSerializer's list (#notation) More...
void | addOptItem (const std::string &path)
| add an item to the TESSerializer's optional list (#notation) More...
bool | analyse (IRegistry *dir, int level) override
| Analysis callback. More...
void | checkItems ()
| print out the contents of m_itemList and m_optItemList (std::cout) More...
virtual | ~TESSerializer ()
Public Member Functions inherited from IDataStoreAgent
virtual | ~IDataStoreAgent ()=default
| destructor More...

## Protected Member Functions
void | addItem (Items &itms, const std::string &descriptor)
| Add item to the list of items to be serialized (#notation) More...
DataStoreItem * | findItem (const std::string &path)
| Find single item identified by its path (exact match) More...

## Private Types
typedef std::vector< DataStoreItem * > | Items
typedef std::vector< std::string > | ItemNames
typedef std::vector< DataObject * > | Objects

## Private Attributes
IDataProviderSvc * | m_TES
| TES pointer. More...
IDataManagerSvc * | m_TESMgr
| TES pointer. More...
ItemNames | m_itemNames
| Vector of item names. More...
Items | m_itemList
| Vector of items to be saved to this stream (DataStoreItem ptrs) More...
ItemNames | m_optItemNames
| Vector of item names (std::strings) More...
Items | m_optItemList
| Vector of optional items to be saved to this stream (DataStoreItem ptrs) More...
DataStoreItem * | m_currentItem
| Current item while traversing the TES tree. More...
Objects | m_objects
| Selected list of Objects to be serialized (DataObject ptrs) More...
std::map< std::string, TClass * > | m_classMap
| Map of gROOT class information. More...
bool | m_verifyItems
| Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer. More...
bool | m_strict
| Boolean Flag used to determine error tolerance. More...
IAddressCreator * | m_addressCreator
| IAddress Creator for Opaque Addresses. More...

## Detailed Description

Definition at line 31 of file TESSerializer.h.

## Member Typedef Documentation

## ◆ ItemNames

typedef std::vector<std::string> GaudiMP::TESSerializer::ItemNames
| private

Definition at line 33 of file TESSerializer.h.

## ◆ Items

typedef std::vector<DataStoreItem*> GaudiMP::TESSerializer::Items
| private

Definition at line 32 of file TESSerializer.h.

## ◆ Objects

typedef std::vector<DataObject*> GaudiMP::TESSerializer::Objects
| private

Definition at line 34 of file TESSerializer.h.

## Constructor & Destructor Documentation

## ◆ TESSerializer()

GaudiMP::TESSerializer::TESSerializer | ( | IDataProviderSvc * | svc,
|  | IAddressCreator * | ac
| ) |  |

Constructor.

Definition at line 51 of file TESSerializer.cpp.

52 : m_TES( svc )
53 , m_TESMgr( dynamic_cast<IDataManagerSvc*>( svc ) )
54 , m_currentItem( 0 )
55 , m_verifyItems( false )
56 , m_strict( false )
57 , m_addressCreator( ac ) {}
GaudiMP::TESSerializer::m_verifyItems
bool m_verifyItems
Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.
Definition: TESSerializer.h:88
GaudiMP::TESSerializer::m_addressCreator
IAddressCreator * m_addressCreator
IAddress Creator for Opaque Addresses.
Definition: TESSerializer.h:92
GaudiMP::TESSerializer::m_strict
bool m_strict
Boolean Flag used to determine error tolerance.
Definition: TESSerializer.h:90
GaudiMP::TESSerializer::m_TESMgr
IDataManagerSvc * m_TESMgr
TES pointer.
Definition: TESSerializer.h:71
GaudiMP::TESSerializer::m_currentItem
DataStoreItem * m_currentItem
Current item while traversing the TES tree.
Definition: TESSerializer.h:81
GaudiMP::TESSerializer::m_TES
IDataProviderSvc * m_TES
TES pointer.
Definition: TESSerializer.h:69

## ◆ ~TESSerializer()

virtual GaudiMP::TESSerializer::~TESSerializer | ( |  | ) |
| inline virtual

Definition at line 58 of file TESSerializer.h.

58 {}

## Member Function Documentation

## ◆ addItem() [1/2]

void GaudiMP::TESSerializer::addItem | ( | const std::string & | path | ) |

add an item to the TESSerializer's list (#notation)

Add item to serialization list; ie append to std::vector of DataStoreItems.

Definition at line 359 of file TESSerializer.cpp.

359 {
360 // #notation supported
361 addItem( m_itemList, path );
362 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
GaudiMP::TESSerializer::m_itemList
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:75
GaudiMP::TESSerializer::addItem
void addItem(const std::string &path)
add an item to the TESSerializer's list (#notation)
Definition: TESSerializer.cpp:359

## ◆ addItem() [2/2]

void GaudiMP::TESSerializer::addItem | ( | Items & | itms,
|  | const std::string & | descriptor
| ) |  |
| protected

Add item to the list of items to be serialized (#notation)

Add item to output streamer list (protected)

Definition at line 313 of file TESSerializer.cpp.

313 {
314 // supports # notation
315 int level = 0;
316
317 std::string slevel;
318 std::string obj_path;
319
320 // Process the incoming string
321 size_t sep = descriptor.rfind( "#" );
322 if ( sep > descriptor.length() ) {
323 // invalid sep case (# not found in string)
324 obj_path = descriptor;
325 slevel = "1";
326 } else {
327 // valid sep case
328 obj_path = descriptor.substr( 0, sep );
329 slevel = descriptor.substr( sep + 1 );
330 }
331
332 // Convert the level string to an integer
333 if ( slevel == "*" ) {
334 level = 9999999;
335 } else {
336 level = std::stoi( slevel );
337 }
338
339 // Are we verifying?
340 if ( m_verifyItems ) {
341 size_t idx = obj_path.find( "/", 1 );
342 while ( idx != std::string::npos ) {
343 std::string sub_item = obj_path.substr( 0, idx );
344 if ( 0 == findItem( sub_item ) ) {
345 cout << "... calling addItem with arg : " << sub_item << endl;
346 addItem( itms, sub_item );
347 }
348 idx = obj_path.find( "/", idx + 1 );
349 }
350 }
351 DataStoreItem* item = new DataStoreItem( obj_path, level );
352 // cout << "Adding TESSerializer item " << item->path()
353 // << " with " << item->depth()
354 // << " level(s)." << endl;
355 itms.push_back( item );
356 }
std::string::rfind
T rfind(T... args)
std::endl
T endl(T... args)
GaudiMP::TESSerializer::m_verifyItems
bool m_verifyItems
Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.
Definition: TESSerializer.h:88
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
std::string
STL class.
GaudiMP::TESSerializer::addItem
void addItem(const std::string &path)
add an item to the TESSerializer's list (#notation)
Definition: TESSerializer.cpp:359
std::string::find
T find(T... args)
std::string::length
T length(T... args)
std::string::substr
T substr(T... args)
gaudirun.level
level
Definition: gaudirun.py:334
GaudiMP::TESSerializer::findItem
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
Definition: TESSerializer.cpp:383
std::cout
std::stoi
T stoi(T... args)

## ◆ addOptItem()

void GaudiMP::TESSerializer::addOptItem | ( | const std::string & | path | ) |

add an item to the TESSerializer's optional list (#notation)

Add optional item to output streamer list.

Definition at line 365 of file TESSerializer.cpp.

365 {
366 // #notation supported
367 addItem( m_optItemList, path );
368 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:79
GaudiMP::TESSerializer::addItem
void addItem(const std::string &path)
add an item to the TESSerializer's list (#notation)
Definition: TESSerializer.cpp:359

## ◆ analyse()

bool GaudiMP::TESSerializer::analyse | ( | IRegistry * | dir,
|  | int | level
| ) |  |
| override virtual

Analysis callback.

Implements IDataStoreAgent.

Definition at line 40 of file TESSerializer.cpp.

40 {
41 if ( level < m_currentItem->depth() ) {
42 if ( dir->object() != 0 ) {
43 m_objects.push_back( dir->object() );
44 return true;
45 }
46 }
47 return false;
48 }
std::vector::push_back
T push_back(T... args)
IRegistry::object
virtual DataObject * object() const =0
Retrieve object behind the link.
GaudiMP::TESSerializer::m_objects
Objects m_objects
Selected list of Objects to be serialized (DataObject ptrs)
Definition: TESSerializer.h:83

## ◆ checkItems()

void GaudiMP::TESSerializer::checkItems | ( |  | ) |

print out the contents of m_itemList and m_optItemList (std::cout)

Uses cout to print the contents of the mandatory and optional item lists.

Definition at line 371 of file TESSerializer.cpp.

371 {
372 cout << "TESSerializer m_itemList : " << m_itemList.size() << " Items" << endl;
373 for ( Items::const_iterator i = m_itemList.begin(); i != m_itemList.end(); ++i ) {
374 cout << "\tItem : " << ( *i )->path() << endl;
375 }
376 cout << "TESSerializer m_optItemList : " << m_optItemList.size() << " Items" << endl;
377 for ( Items::const_iterator i = m_optItemList.begin(); i != m_optItemList.end(); ++i ) {
378 cout << "\tItem : " << ( *i )->path() << endl;
379 }
380 }
std::endl
T endl(T... args)
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:79
std::vector::end
T end(T... args)
GaudiMP::TESSerializer::m_itemList
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:75
std::vector::size
T size(T... args)
std::vector::begin
T begin(T... args)
std::cout

## ◆ dumpBuffer()

void GaudiMP::TESSerializer::dumpBuffer | ( | TBufferFile & | buffer | ) |

Dump TES contents listed in m_itemList/m_optItemList to a TBufferFile.

Serialize contents of TES to a TBufferFile.

Definition at line 60 of file TESSerializer.cpp.

60 {
61 //
62 // Write all valid objects to the TBufferFile provided in the argument
63 // As objects are collected, the member variable m_classMap is filled
64 // with ROOT Class data, and is kept by the Serializer for future
65 // reference
66 //
67 // @paramTBufferFile& buffer : TBufferFile passed by reference
68 // Cannot be declared inside the method, as repeated calls
69 // can cause confusion and buffer wiping.
70 //
71 StatusCode status;
72 DataObject* obj;
73
74 // Clear current selection
75 m_objects.erase( m_objects.begin(), m_objects.end() );
76
77 // Traverse the tree and collect the requested objects
78 for ( Items::iterator i = m_itemList.begin(); i != m_itemList.end(); i++ ) {
79 m_currentItem = ( *i );
80 // cout << "Retrieving Mandatory Object : " << m_currentItem->path() << endl;
81 status = m_TES->retrieveObject( m_currentItem->path(), obj );
82 if ( status.isSuccess() ) {
83 m_TESMgr->traverseSubTree( obj, this );
84 } else {
85 string text( "WARNING: Cannot retrieve TES object(s) for serialisation: " );
86 text += m_currentItem->path();
87 if ( m_strict ) {
88 throw GaudiException( text + m_currentItem->path(), "", status );
89 } else {
90 cout << text << endl;
91 // return StatusCode::FAILURE;
92 }
93 }
94 }
95 // Traverse the tree and collect the requested objects (tolerate missing items here)
96 for ( Items::iterator i = m_optItemList.begin(); i != m_optItemList.end(); i++ ) {
97 m_currentItem = ( *i );
98 // cout << "Retrieving Optional Object : " << m_currentItem->path() << endl;
99 status = m_TES->retrieveObject( m_currentItem->path(), obj );
100 if ( status.isSuccess() ) { m_TESMgr->traverseSubTree( obj, this ); }
101 }
102
103 // cout << "TESSerializer : Beginning loop to write to TBufferFile for nObjects : " << m_objects.size() << endl;
104 buffer.WriteInt( m_objects.size() );
105
106 for ( Objects::iterator i = m_objects.begin(); i != m_objects.end(); ++i ) {
107 DataObject* pObj = ( *i ); /* define pointer !pObj! to a data object */
108 DataObjectPush p( pObj ); /* add the data object to the list... */
109
110 // We build a map so gROOT has to access the whole class database as little as possible
111 TClass* cl; /* announce a TClass */
112 const type_info& objClass = typeid( *pObj ); /* get the type of the data object */
113 // cout << "TES Object : " << pObj->registry()->identifier() << endl;
114 string objClassName = System::typeinfoName( objClass ); /* and then get the descriptive string from System */
115
116 /* First go : populate the class map
117 Subsequent : refer to class map */
118 if ( m_classMap[objClassName] ) {
119 cl = m_classMap[objClassName];
120 } else {
121 /* Map new object : pull the class name from the objects c_str() method */
122 const char* clName = objClassName.c_str();
123 /* Find the relevant Tclass (cl) in gROOT, and fill the map entry */
124 cl = gROOT->GetClass( clName );
125 m_classMap[objClassName] = cl;
126 }
127
128 /* Now, check if clname was valid... */
129 if ( cl == 0 ) {
130 if ( m_strict ) {
131 throw GaudiException( "gROOT->GetClass cannot find clName", objClassName, StatusCode::FAILURE );
132 } else {
133 cout << "WARNING: gROOT->GetClass fails for clname : " << objClassName.c_str() << endl;
134 cout << "WARNING: Disregarding " << objClassName.c_str() << "erasing from object list" << endl;
135 m_objects.erase( i );
136 continue;
137 }
138 }
139
140 // write object to buffer in order location-name-object
141 std::string loc = pObj->registry()->identifier();
142 buffer.WriteString( loc.c_str() );
143 buffer.WriteString( cl->GetName() );
144 cl->Streamer( pObj, buffer );
145
146 /* take care of links */
147 LinkManager* linkMgr = pObj->linkMgr();
148 int numLinks = linkMgr->size();
149 buffer.WriteInt( numLinks );
150 // now write each link
151 for ( int it = 0; it != numLinks; it++ ) {
152 const string& link = linkMgr->link( it )->path();
153 buffer.WriteString( link.c_str() );
154 }
155
156 // now do the thing with the opaqueAddress
157 // to go from string->object when recovering, will need svc_type, and clid, aswell as the string version
158 IOpaqueAddress* iop = pObj->registry()->address();
159 if ( iop ) {
160 buffer.WriteInt( 1 );
161 const string* par = iop->par();
162 long svcType = iop->svcType();
163 long clid = iop->clID();
164 buffer.WriteLong( svcType );
165 buffer.WriteLong( clid );
166 buffer.WriteString( par->c_str() );
167 } else {
168 buffer.WriteInt( 0 );
169 }
170 // object complete, continue in for-loop
171 }
172
173 // Final Actions
174 // Write the End Flag, to avoid potential SegFaults on loadBuffer
175 buffer.WriteString( SERIALIZER_END );
176 // return StatusCode::SUCCESS;
177 }
IOpaqueAddress::par
virtual const std::string * par() const =0
Retrieve String parameters.
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
IDataManagerSvc::traverseSubTree
virtual StatusCode traverseSubTree(std::string_view sub_tree_path, IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects below the sub tree identified by its full path name.
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
DataObject::linkMgr
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:74
std::endl
T endl(T... args)
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:79
std::vector::end
T end(T... args)
IOpaqueAddress::svcType
virtual long svcType() const =0
Retrieve service type.
GaudiMP::TESSerializer::m_itemList
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:75
GaudiMP::TESSerializer::m_strict
bool m_strict
Boolean Flag used to determine error tolerance.
Definition: TESSerializer.h:90
std::type_info
std::string
STL class.
compareOutputFiles.par
string par
Definition: compareOutputFiles.py:465
GaudiMP::TESSerializer::m_TESMgr
IDataManagerSvc * m_TESMgr
TES pointer.
Definition: TESSerializer.h:71
IOpaqueAddress::clID
virtual const CLID & clID() const =0
Retrieve class information from link.
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
LinkManager::Link::path
const std::string & path() const
Access to path of object.
Definition: LinkManager.h:61
std::vector::erase
T erase(T... args)
LinkManager::link
Link * link(long id)
Retrieve symbolic link identified by ID.
Definition: LinkManager.cpp:29
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
std::vector::size
T size(T... args)
IDataProviderSvc::retrieveObject
virtual StatusCode retrieveObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Retrieve object identified by its directory entry.
std::vector::begin
T begin(T... args)
GaudiMP::TESSerializer::m_objects
Objects m_objects
Selected list of Objects to be serialized (DataObject ptrs)
Definition: TESSerializer.h:83
std::string::c_str
T c_str(T... args)
LinkManager::size
long size() const
Retrieve number of link present.
Definition: LinkManager.h:100
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
IRegistry::identifier
virtual const id_type & identifier() const =0
Full identifier (or key)
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
GaudiMP::TESSerializer::m_currentItem
DataStoreItem * m_currentItem
Current item while traversing the TES tree.
Definition: TESSerializer.h:81
SERIALIZER_END
#define SERIALIZER_END
Definition: TESSerializer.cpp:29
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
std::cout
LinkManager
A LinkManager is the object aggregated into a DataObject, which is responsible for the handling of no...
Definition: LinkManager.h:21
GaudiMP::TESSerializer::m_TES
IDataProviderSvc * m_TES
TES pointer.
Definition: TESSerializer.h:69
DataStoreItem::path
const std::string & path() const
Accessor: Retrieve load path.
Definition: DataStoreItem.h:55
GaudiMP::TESSerializer::m_classMap
std::map< std::string, TClass * > m_classMap
Map of gROOT class information.
Definition: TESSerializer.h:86

## ◆ findItem()

DataStoreItem * GaudiMP::TESSerializer::findItem | ( | const std::string & | path | ) |
| protected

Find single item identified by its path (exact match)

Definition at line 383 of file TESSerializer.cpp.

383 {
384 for ( Items::const_iterator i = m_itemList.begin(); i != m_itemList.end(); ++i ) {
385 if ( ( *i )->path() == path ) return ( *i );
386 }
387 for ( Items::const_iterator j = m_optItemList.begin(); j != m_optItemList.end(); ++j ) {
388 if ( ( *j )->path() == path ) return ( *j );
389 }
390 return 0;
391 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:79
std::vector::end
T end(T... args)
GaudiMP::TESSerializer::m_itemList
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:75
std::vector::begin
T begin(T... args)

## ◆ loadBuffer()

void GaudiMP::TESSerializer::loadBuffer | ( | TBufferFile & | buffer | ) |

Rebuild TES from items in a TBufferFile.

Reconstruct the TES from a given TBufferFile.

The next is equivalent to ReadObjectAny(cl) except of the 'magic!!'

Definition at line 180 of file TESSerializer.cpp.

180 {
181
182 // reverse mechanism of dumps
183 // buffer is: length of DataObjects vector
184 // location string
185 // type name string
186 // the object itself
187 // count of links
188 // list of links (conditional on count)
189 // flag indicating Opaque Address presence
190 // Opaque Address svcType (conditional on flag)
191 // Opaque Address clID (conditional on flag)
192 // Opaque Address par (conditional on flag)
193
194 int nObjects;
195 // 3 StatusCodes... for :
196 // general use : registering objects : creating OpaqueAddresses
197 StatusCode sc, registerStat, createAddressStat;
198
199 // Prepare for Reading
200 buffer.SetReadMode();
201 buffer.SetBufferOffset();
202
203 buffer.ReadInt( nObjects );
204 for ( int i = 0; i < nObjects; ++i ) {
205 char text[4096];
206 buffer.ReadString( text, sizeof( text ) );
207 string location( text );
208 if ( !location.compare( "EOF" ) ) {
209 /* There was an error in serialization, but the EOF
210 flag marks the endpoint in any case */
211 break;
212 }
213 buffer.ReadString( text, sizeof( text ) );
214 TClass* cl = gROOT->GetClass( text );
215 if ( cl == 0 ) {
216 if ( m_strict ) {
217 throw GaudiException( "gROOT->GetClass cannot find clName", text, StatusCode::FAILURE );
218 } else {
219 cout << "TESSerializer WARNING : gROOT->GetClass fails for clname : " << location.c_str() << endl;
220 continue;
221 }
222 }
223
225 DataObject* obj = (DataObject*)cl->New();
226 DataObjectPush push( obj ); // This is magic!
227 cl->Streamer( obj, buffer );
228
229 // now restore links
230 if ( obj ) {
231 int nlink = 0;
232 LinkManager* lnkMgr = obj->linkMgr();
233 buffer.ReadInt( nlink );
234
235 for ( int j = 0; j < nlink; ++j ) {
236 buffer.ReadString( text, sizeof( text ) );
237 lnkMgr->addLink( text, 0 );
238 }
239 }
240
241 // Re-register...
242 registerStat = m_TES->registerObject( location, obj );
243 if ( registerStat.isFailure() ) {
244 DataObject* dummy = NULL;
245 if ( location == "/Event" ) {
246 sc = m_TESMgr->setRoot( location, obj );
247 if ( sc.isFailure() ) throw GaudiException( "Cannot set root at location " + location, "", sc );
248 } else {
249 m_TES->findObject( location, dummy );
250 if ( !dummy )
251 m_TES->registerObject( location, obj );
252 else {
253 // skipping to the next object
254 // (flush the remaining metadata in the buffer)
255 int flag( 0 );
256 buffer.ReadInt( flag );
257 if ( flag ) {
258 long svcType;
259 buffer.ReadLong( svcType );
260 long clid;
261 buffer.ReadLong( clid );
262 buffer.ReadString( text, sizeof( text ) );
263 }
264 continue;
265 }
266 }
267 }
268 // next is the opaque address information
269 // create Generic Address using the info from the TBufferFile,
270 // then create an IOpaqueAddress object using the Persistency Svc
271 // IOpaque Address pointer (blank... pass the ref to the createAddress Fn)
272
273 int flag( 0 );
274 buffer.ReadInt( flag );
275 // flag will be 0 or 1 to indicate OpaqueAddress Info
276 if ( flag == 1 ) {
277 // will need an IOpaqueAddress and its ref
278 IOpaqueAddress* iop;
279 IOpaqueAddress*& iopref = iop;
280 // Read svcType, clID and par from buffer
281 long svcType;
282 buffer.ReadLong( svcType );
283
284 long clid;
285 buffer.ReadLong( clid );
286 const CLID classid( clid );
287
288 char* cp;
289 cp = buffer.ReadString( text, sizeof( text ) );
290 const string opaque( cp );
291 // create Generic address
292 // already have svcType, clID, par1.. just make dummy variables for par2, and ipar1 and 2
293 const string& p2 = "";
294 unsigned long ip1( 0 );
295 unsigned long ip2( 0 );
296 GenericAddress gadd( svcType, classid, opaque, p2, ip1, ip2 );
297
298 // now create the address
299 createAddressStat =
300 m_addressCreator->createAddress( gadd.svcType(), gadd.clID(), gadd.par(), gadd.ipar(), iopref );
301 if ( createAddressStat.isFailure() ) {
302 throw GaudiException( "Failure in creating OpaqueAddress for reconstructed registry", "", createAddressStat );
303 }
304 // And finally, set this address
305 obj->registry()->setAddress( iop );
306 }
307 // all done
308 }
309 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
DataObject::registry
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
IAddressCreator::createAddress
virtual StatusCode createAddress(long svc_type, const CLID &clid, const std::string *par, const unsigned long *ipar, IOpaqueAddress *&refpAddress)=0
Create a Generic address using explicit arguments to identify a single object.
DataObject::linkMgr
LinkManager * linkMgr() const
Retrieve Link manager.
Definition: DataObject.h:74
IDataManagerSvc::setRoot
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
GaudiPython.HistoUtils.location
location
Definition: HistoUtils.py:936
std::endl
T endl(T... args)
GenericAddress
Generic Transient Address.
Definition: GenericAddress.h:20
GaudiMP::TESSerializer::m_addressCreator
IAddressCreator * m_addressCreator
IAddress Creator for Opaque Addresses.
Definition: TESSerializer.h:92
IDataProviderSvc::findObject
virtual StatusCode findObject(IRegistry *pDirectory, std::string_view path, DataObject *&pObject)=0
Find object identified by its directory entry.
GaudiMP::TESSerializer::m_strict
bool m_strict
Boolean Flag used to determine error tolerance.
Definition: TESSerializer.h:90
GaudiMP::TESSerializer::m_TESMgr
IDataManagerSvc * m_TESMgr
TES pointer.
Definition: TESSerializer.h:71
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
compareOutputFiles.cp
cp
Definition: compareOutputFiles.py:496
IDataProviderSvc::registerObject
StatusCode registerObject(std::string_view fullPath, DataObject *pObject)
Register object with the data store.
Definition: IDataProviderSvc.h:62
IRegistry::setAddress
virtual void setAddress(IOpaqueAddress *pAddress)=0
Set/Update Opaque storage address.
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
std::cout
LinkManager
A LinkManager is the object aggregated into a DataObject, which is responsible for the handling of no...
Definition: LinkManager.h:21
GaudiMP::TESSerializer::m_TES
IDataProviderSvc * m_TES
TES pointer.
Definition: TESSerializer.h:69
LinkManager::addLink
long addLink(const std::string &path, const DataObject *pObject) const
Add link by object reference and path.
Definition: LinkManager.cpp:54

## Member Data Documentation

## ◆ m_addressCreator

IAddressCreator* GaudiMP::TESSerializer::m_addressCreator
| private

IAddress Creator for Opaque Addresses.

Definition at line 92 of file TESSerializer.h.

## ◆ m_classMap

std::map<std::string, TClass*> GaudiMP::TESSerializer::m_classMap
| private

Map of gROOT class information.

Definition at line 86 of file TESSerializer.h.

## ◆ m_currentItem

DataStoreItem* GaudiMP::TESSerializer::m_currentItem
| private

Current item while traversing the TES tree.

Definition at line 81 of file TESSerializer.h.

## ◆ m_itemList

Items GaudiMP::TESSerializer::m_itemList
| private

Vector of items to be saved to this stream (DataStoreItem ptrs)

Definition at line 75 of file TESSerializer.h.

## ◆ m_itemNames

ItemNames GaudiMP::TESSerializer::m_itemNames
| private

Vector of item names.

Definition at line 73 of file TESSerializer.h.

## ◆ m_objects

Objects GaudiMP::TESSerializer::m_objects
| private

Selected list of Objects to be serialized (DataObject ptrs)

Definition at line 83 of file TESSerializer.h.

## ◆ m_optItemList

Items GaudiMP::TESSerializer::m_optItemList
| private

Vector of optional items to be saved to this stream (DataStoreItem ptrs)

Definition at line 79 of file TESSerializer.h.

## ◆ m_optItemNames

ItemNames GaudiMP::TESSerializer::m_optItemNames
| private

Vector of item names (std::strings)

Definition at line 77 of file TESSerializer.h.

## ◆ m_strict

bool GaudiMP::TESSerializer::m_strict
| private

Boolean Flag used to determine error tolerance.

Definition at line 90 of file TESSerializer.h.

## ◆ m_TES

IDataProviderSvc* GaudiMP::TESSerializer::m_TES
| private

TES pointer.

Definition at line 69 of file TESSerializer.h.

## ◆ m_TESMgr

IDataManagerSvc* GaudiMP::TESSerializer::m_TESMgr
| private

TES pointer.

Definition at line 71 of file TESSerializer.h.

## ◆ m_verifyItems

bool GaudiMP::TESSerializer::m_verifyItems
| private

Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.

Definition at line 88 of file TESSerializer.h.

The documentation for this class was generated from the following files:

- GaudiMP/GaudiMP/TESSerializer.h
- GaudiMP/src/Lib/TESSerializer.cpp