| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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)
| 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

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

Definition at line 33 of file TESSerializer.h.

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

Definition at line 32 of file TESSerializer.h.

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

Definition at line 34 of file TESSerializer.h.

## Constructor & Destructor Documentation

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

Constructor.

Definition at line 56 of file TESSerializer.cpp.

57 : m_TES(svc)
58 , m_TESMgr(dynamic_cast<IDataManagerSvc*>(svc))
59 , m_currentItem(0)
60 , m_verifyItems(false)
61 , m_strict(false)
62 , m_addressCreator(ac)
63 {
64 }
GaudiMP::TESSerializer::m_verifyItems
bool m_verifyItems
Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.
Definition: TESSerializer.h:87
GaudiMP::TESSerializer::m_addressCreator
IAddressCreator * m_addressCreator
IAddress Creator for Opaque Addresses.
Definition: TESSerializer.h:91
GaudiMP::TESSerializer::m_strict
bool m_strict
Boolean Flag used to determine error tolerance.
Definition: TESSerializer.h:89
GaudiMP::TESSerializer::m_TESMgr
IDataManagerSvc * m_TESMgr
TES pointer.
Definition: TESSerializer.h:70
GaudiMP::TESSerializer::m_currentItem
DataStoreItem * m_currentItem
Current item while traversing the TES tree.
Definition: TESSerializer.h:80
GaudiMP::TESSerializer::m_TES
IDataProviderSvc * m_TES
TES pointer.
Definition: TESSerializer.h:68

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

Definition at line 57 of file TESSerializer.h.

57 {}

## Member Function Documentation

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 374 of file TESSerializer.cpp.

374 {
375 // #notation supported
376 addItem( m_itemList, path );
377 }
GaudiMP::TESSerializer::m_itemList
Items m_itemList
Vector of items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:74
GaudiMP::TESSerializer::addItem
void addItem(const std::string &path)
add an item to the TESSerializer's list (#notation)
Definition: TESSerializer.cpp:374

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 327 of file TESSerializer.cpp.

327 {
328 // supports # notation
329 int level = 0;
330
331 std::string slevel;
332 std::string obj_path;
333
334 // Process the incoming string
335 size_t sep = descriptor.rfind("#");
336 if (sep > descriptor.length()) {
337 // invalid sep case (# not found in string)
338 obj_path = descriptor;
339 slevel = "1";
340 } else {
341 // valid sep case
342 obj_path = descriptor.substr(0,sep);
343 slevel = descriptor.substr(sep+1);
344 }
345
346 // Convert the level string to an integer
347 if ( slevel == "*" ) {
348 level = 9999999;
349 }
350 else {
351 level = std::stoi(slevel);
352 }
353
354 // Are we verifying?
355 if ( m_verifyItems ) {
356 size_t idx = obj_path.find("/",1);
357 while(idx != std::string::npos) {
358 std::string sub_item = obj_path.substr(0,idx);
359 if ( 0 == findItem(sub_item) ) {
360 cout << "... calling addItem with arg : " << sub_item << endl;
361 addItem(itms, sub_item);
362 }
363 idx = obj_path.find("/",idx+1);
364 }
365 }
366 DataStoreItem* item = new DataStoreItem(obj_path, level);
367 //cout << "Adding TESSerializer item " << item->path()
368 // << " with " << item->depth()
369 // << " level(s)." << endl;
370 itms.push_back( item );
371 }
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:87
DataStoreItem
Description of the DataStoreItem class.
Definition: DataStoreItem.h:17
std::string
STL class.
std::list::push_back
T push_back(T...args)
GaudiMP::TESSerializer::addItem
void addItem(const std::string &path)
add an item to the TESSerializer's list (#notation)
Definition: TESSerializer.cpp:374
std::string::find
T find(T...args)
std::string::length
T length(T...args)
ana.item
tuple item
print s1,s2
Definition: ana.py:146
std::string::substr
T substr(T...args)
gaudirun.level
level
Definition: gaudirun.py:261
GaudiMP::TESSerializer::findItem
DataStoreItem * findItem(const std::string &path)
Find single item identified by its path (exact match)
Definition: TESSerializer.cpp:399
ana.itms
list itms
Definition: ana.py:135
std::cout
std::stoi
T stoi(T...args)

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 380 of file TESSerializer.cpp.

380 {
381 // #notation supported
382 addItem( m_optItemList, path);
383 }
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:78
GaudiMP::TESSerializer::addItem
void addItem(const std::string &path)
add an item to the TESSerializer's list (#notation)
Definition: TESSerializer.cpp:374

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

Analysis callback.

Implements IDataStoreAgent.

Definition at line 45 of file TESSerializer.cpp.

45 {
46 if ( level < m_currentItem->depth() ) {
47 if ( dir->object() != 0 ) {
48 m_objects.push_back(dir->object());
49 return true;
50 }
51 }
52 return false;
53 }
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:82

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 386 of file TESSerializer.cpp.

386 {
387 cout << "TESSerializer m_itemList : " << m_itemList.size() << " Items"<< endl;
388 for(Items::const_iterator i=m_itemList.begin(); i != m_itemList.end(); ++i) {
389 cout << "\tItem : " << (*i)->path() << endl;
390 }
391 cout << "TESSerializer m_optItemList : " << m_optItemList.size() << " Items" << endl;
392 for(Items::const_iterator i=m_optItemList.begin(); i != m_optItemList.end(); ++i) {
393 cout << "\tItem : " << (*i)->path() << endl;
394 }
395 }
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:78
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:74
std::vector::size
T size(T...args)
std::vector::begin
T begin(T...args)
ana.i
list i
Definition: ana.py:128
std::cout

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 67 of file TESSerializer.cpp.

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

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

Find single item identified by its path (exact match)

Definition at line 399 of file TESSerializer.cpp.

399 {
400 for(Items::const_iterator i=m_itemList.begin(); i != m_itemList.end(); ++i) {
401 if ( (*i)->path() == path ) return (*i);
402 }
403 for(Items::const_iterator j=m_optItemList.begin(); j != m_optItemList.end(); ++j) {
404 if ( (*j)->path() == path ) return (*j);
405 }
406 return 0;
407 }
GaudiMP::TESSerializer::m_optItemList
Items m_optItemList
Vector of optional items to be saved to this stream (DataStoreItem ptrs)
Definition: TESSerializer.h:78
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:74
Gaudi::Utils::Histos::path
GAUDI_API std::string path(const AIDA::IBaseHistogram *aida)
get the path in THS for AIDA histogram
Definition: HistoTableFormat.cpp:191
std::vector::begin
T begin(T...args)
ana.i
list i
Definition: ana.py:128

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 192 of file TESSerializer.cpp.

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

## Member Data Documentation

IAddressCreator* GaudiMP::TESSerializer::m_addressCreator
| private

IAddress Creator for Opaque Addresses.

Definition at line 91 of file TESSerializer.h.

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

Map of gROOT class information.

Definition at line 85 of file TESSerializer.h.

DataStoreItem* GaudiMP::TESSerializer::m_currentItem
| private

Current item while traversing the TES tree.

Definition at line 80 of file TESSerializer.h.

Items GaudiMP::TESSerializer::m_itemList
| private

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

Definition at line 74 of file TESSerializer.h.

ItemNames GaudiMP::TESSerializer::m_itemNames
| private

Vector of item names.

Definition at line 72 of file TESSerializer.h.

Objects GaudiMP::TESSerializer::m_objects
| private

Selected list of Objects to be serialized (DataObject ptrs)

Definition at line 82 of file TESSerializer.h.

Items GaudiMP::TESSerializer::m_optItemList
| private

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

Definition at line 78 of file TESSerializer.h.

ItemNames GaudiMP::TESSerializer::m_optItemNames
| private

Vector of item names (std::strings)

Definition at line 76 of file TESSerializer.h.

bool GaudiMP::TESSerializer::m_strict
| private

Boolean Flag used to determine error tolerance.

Definition at line 89 of file TESSerializer.h.

IDataProviderSvc* GaudiMP::TESSerializer::m_TES
| private

TES pointer.

Definition at line 68 of file TESSerializer.h.

IDataManagerSvc* GaudiMP::TESSerializer::m_TESMgr
| private

TES pointer.

Definition at line 70 of file TESSerializer.h.

bool GaudiMP::TESSerializer::m_verifyItems
| private

Boolean Flag as used by GaudiSvc/PersistencySvc/OutputStreamer.

Definition at line 87 of file TESSerializer.h.

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

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