Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v38r0 (2143aa4c)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PersistencySvc.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 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 //====================================================================
12 // PersistencySvc.cpp
13 //--------------------------------------------------------------------
14 //
15 // Package : System ( The LHCb Offline System)
16 //
17 // Description: implementation of the PersistencySvc
18 //
19 // Author : M.Frank
20 // History :
21 // +---------+----------------------------------------------+---------
22 // | Date | Comment | Who
23 // +---------+----------------------------------------------+---------
24 // | 29/10/98| Initial version | MF
25 // +---------+----------------------------------------------+---------
26 //
27 //====================================================================
28 #define PERSISTENCYSVC_PERSISTENCYSVC_CPP
29 
30 // Interface definitions
31 #include "GaudiKernel/DataObject.h"
32 #include "GaudiKernel/IConverter.h"
37 #include "GaudiKernel/MsgStream.h"
38 #include "GaudiKernel/SmartIF.h"
40 #include "GaudiKernel/strcasecmp.h"
41 
42 // Implementation specific definitions
43 #include "PersistencySvc.h"
44 
45 // Instantiation of a static factory class used by clients to create
46 // instances of this service
48 
58 };
59 
60 StatusCode PersistencySvc::makeCall( int typ, IOpaqueAddress*& pAddress, DataObject*& pObject ) {
61  if ( m_enable ) {
62  IConversionSvc* svc = nullptr;
63  switch ( typ ) {
64  case CREATE_REP:
65  case FILL_REP_REFS:
66  case UPDATE_REP:
67  case UPDATE_REP_REFS:
68  svc = m_cnvDefault;
69  break;
70  default:
71  if ( !pAddress ) return Status::INVALID_ADDRESS;
72  svc = service( pAddress->svcType() );
73  if ( !svc ) return Status::BAD_STORAGE_TYPE;
74  break;
75  }
76 
78  switch ( typ ) {
79  case CREATE_OBJ:
80  pObject = nullptr;
81  status = svc->createObj( pAddress, pObject );
82  break;
83  case FILL_OBJ_REFS:
84  status = svc->fillObjRefs( pAddress, pObject );
85  break;
86  case UPDATE_OBJ:
87  status = svc->updateObj( pAddress, pObject );
88  break;
89  case UPDATE_OBJ_REFS:
90  status = svc->updateObjRefs( pAddress, pObject );
91  break;
92  case CREATE_REP:
93  status = svc->createRep( pObject, pAddress );
94  break;
95  case FILL_REP_REFS:
96  status = svc->fillRepRefs( pAddress, pObject );
97  break;
98  case UPDATE_REP:
99  status = svc->updateRep( pAddress, pObject );
100  break;
101  case UPDATE_REP_REFS:
102  status = svc->updateRepRefs( pAddress, pObject );
103  break;
104  default:
105  status = StatusCode::FAILURE;
106  break;
107  }
108  status.ignore();
109  return status;
110  }
111  return StatusCode::SUCCESS;
112 }
113 
116  return makeCall( CREATE_OBJ, pAddr, refpObj );
117 }
118 
121  return makeCall( FILL_OBJ_REFS, pAddr, pObj );
122 }
123 
126  return makeCall( UPDATE_OBJ, pAddr, pObj );
127 }
128 
131  return makeCall( UPDATE_OBJ_REFS, pAddr, pObj );
132 }
133 
136  return makeCall( CREATE_REP, refpAddr, pObj );
137 }
138 
141  return makeCall( FILL_REP_REFS, pAddr, pObj );
142 }
143 
146  return makeCall( UPDATE_REP, pAddr, pObj );
147 }
148 
151  return makeCall( UPDATE_REP_REFS, pAddr, pObj );
152 }
153 
156  long typ = type;
157  auto it = m_cnvServices.find( typ );
158  if ( it == m_cnvServices.end() ) {
160  if ( s ) {
161  it = m_cnvServices.find( typ );
162  if ( it != m_cnvServices.end() ) return it->second.addrCreator();
163  }
164  static SmartIF<IAddressCreator> no_creator;
165  return no_creator;
166  }
167  return it->second.addrCreator();
168 }
169 
172  m_dataSvc = pDataSvc;
173  for ( auto& i : m_cnvServices ) { i.second.conversionSvc()->setDataProvider( m_dataSvc ).ignore(); }
174  return StatusCode::SUCCESS;
175 }
176 
179 
182  m_cnvDefault = svc;
183  return StatusCode::SUCCESS;
184 }
185 
188 
191 
194  if ( !pConverter ) return Status::NO_CONVERTER;
195  IConversionSvc* svc = service( pConverter->repSvcType() );
196  return svc ? svc->addConverter( pConverter ) : Status::BAD_STORAGE_TYPE;
197 }
198 
201  // Remove converter type from all services
202  StatusCode status = Status::NO_CONVERTER, iret = StatusCode::SUCCESS;
203  for ( auto& i : m_cnvServices ) {
204  iret = i.second.conversionSvc()->removeConverter( clid );
205  if ( iret.isSuccess() ) status = iret;
206  }
207  return status;
208 }
209 
211 IConverter* PersistencySvc::converter( const CLID& /*clid*/ ) { return nullptr; }
212 
217  [&]( Services::const_reference i ) { return i.second.service()->name() == tn.name(); } );
218  if ( it != m_cnvServices.end() ) return it->second.conversionSvc();
219 
220  auto svc = Service::service<IConversionSvc>( nam, true );
221  if ( svc && addCnvService( svc.get() ).isSuccess() ) {
222  return service( nam ); // now it is in the list
223  }
224 
225  info() << "Cannot access Conversion service:" << nam << endmsg;
226  static SmartIF<IConversionSvc> no_svc;
227  return no_svc;
228 }
229 
232  // Check wether this is already an active service
233  auto it = m_cnvServices.find( type );
234  if ( it != m_cnvServices.end() ) return it->second.conversionSvc();
235  // if not, check if the service is in the list and may be requested
236  for ( const auto& i : m_svcNames.value() ) {
237  auto& svc = service( i );
238  if ( svc && svc->repSvcType() == type ) return svc;
239  }
240  static SmartIF<IConversionSvc> no_svc;
241  return no_svc;
242 }
243 
246  if ( !servc ) return Status::BAD_STORAGE_TYPE;
247  long type = servc->repSvcType();
248  long def_typ = ( m_cnvDefault ? m_cnvDefault->repSvcType() : 0 );
249  auto it = m_cnvServices.find( type );
250  auto cnv_svc = ( it != m_cnvServices.end() ? it->second.conversionSvc() : nullptr );
251  if ( type == def_typ ) m_cnvDefault = servc;
252  if ( cnv_svc == servc ) return StatusCode::SUCCESS;
253 
254  auto iservc = make_SmartIF( servc );
255  auto icr = iservc.as<IAddressCreator>();
256  if ( icr ) {
257  auto isvc = iservc.as<IService>();
258  if ( isvc ) {
259  if ( cnv_svc ) removeCnvService( type ).ignore();
260  auto p = m_cnvServices.emplace( type, ServiceEntry( type, isvc, iservc, icr ) );
261  if ( !p.second ) {
262  info() << "Cannot add Conversion service of type " << isvc->name() << endmsg;
263  return StatusCode::FAILURE;
264  }
265  info() << "Added successfully Conversion service:" << isvc->name() << endmsg;
266  iservc->setAddressCreator( this ).ignore();
267  iservc->setDataProvider( m_dataSvc ).ignore();
268  return StatusCode::SUCCESS;
269  }
270  }
271  info() << "Cannot add Conversion service of type " << type << endmsg;
272  return StatusCode::FAILURE;
273 }
274 
277  auto it = m_cnvServices.find( svctype );
278  if ( it == m_cnvServices.end() ) return Status::BAD_STORAGE_TYPE;
279  it->second.service()->release();
280  it->second.addrCreator()->release();
281  m_cnvServices.erase( it );
282  return StatusCode::SUCCESS;
283 }
284 
286 long PersistencySvc::repSvcType() const { return m_cnvDefault ? m_cnvDefault->repSvcType() : 0; }
287 
291  return StatusCode::SUCCESS;
292 }
293 
295 StatusCode PersistencySvc::connectOutput( const std::string& outputFile, const std::string& /* openMode */ ) {
296  return connectOutput( outputFile );
297 }
298 
301 
304 
306 StatusCode PersistencySvc::createAddress( long svc_type, const CLID& clid, const std::string* pars,
307  const unsigned long* ipars, IOpaqueAddress*& refpAddress ) {
308  refpAddress = nullptr;
309  IAddressCreator* svc = addressCreator( svc_type );
310  return svc ? svc->createAddress( svc_type, clid, pars, ipars, refpAddress ) : Status::BAD_STORAGE_TYPE;
311 }
312 
315  // Assumuption is that the Persistency service prepends a header
316  // and requests the conversion service refered to by the service
317  // type to encode the rest
318  long svc_type = 0;
319  CLID clid = 0;
320  if ( pAddress ) {
321  svc_type = pAddress->svcType();
322  clid = pAddress->clID();
323  }
324  IAddressCreator* svc = addressCreator( svc_type );
325  StatusCode status = Status::BAD_STORAGE_TYPE; // Preset error
326  refAddress.clear();
327 
328  if ( svc ) {
329  // Found service, set header
330  encodeAddrHdr( svc_type, clid, refAddress );
331  std::string address;
332  // Get rest of address from conversion service
333  status = svc->convertAddress( pAddress, address );
334  refAddress += address;
335  }
336  return status;
337 }
338 
340 StatusCode PersistencySvc::createAddress( long /* svc_type */, const CLID& /* clid */, const std::string& refAddress,
341  IOpaqueAddress*& refpAddress ) {
342  // Assumption is that the Persistency service decodes that header
343  // and requests the conversion service referred to by the service
344  // type to decode the rest
345  long new_svc_type = 0;
346  CLID new_clid = 0;
347  std::string address_trailer;
348  decodeAddrHdr( refAddress, new_svc_type, new_clid, address_trailer );
349  IAddressCreator* svc = addressCreator( new_svc_type );
350  return svc ? svc->createAddress( new_svc_type, new_clid, address_trailer, refpAddress ) : Status::BAD_STORAGE_TYPE;
351 }
352 
354 void PersistencySvc::encodeAddrHdr( long service_type, const CLID& clid, std::string& address ) const {
355  // For address header, use xml-style format of
356  // <addrhdr service_type="xxx" clid="yyy" />
358  int svctyp = service_type; // must put int into stream, not char
359  stream << "<address_header service_type=\"" << svctyp << "\" clid=\"" << clid << "\" /> ";
360  address = stream.str();
361 }
362 
364 void PersistencySvc::decodeAddrHdr( const std::string& address, long& service_type, CLID& clid,
365  std::string& address_trailer ) const {
366  // For address header, use xml-style format of
367  // <address_header service_type="xxx" clid="yyy" />
368  service_type = 0;
369  clid = 0;
370  address_trailer.clear();
371 
372  // Check for address_header tag
373  size_t pos = address.find( "<address_header" );
374  if ( std::string::npos != pos ) {
375  // Get service_type
376  pos = address.find( "service_type=\"" );
377  if ( std::string::npos != pos ) {
378  pos += 14;
379  size_t end = address.find( '"', pos );
380  if ( std::string::npos != end ) {
381  service_type = std::stol( address.substr( pos, end - pos ) );
382  // Get clid
383  pos = address.find( "clid=\"" );
384  if ( std::string::npos != pos ) {
385  pos += 6;
386  end = address.find( '\"', pos );
387  if ( std::string::npos != end ) {
388  std::istringstream str;
389  str.str( address.substr( pos, end - pos ) );
390  str >> clid;
391  // Get trailer_address
392  pos = address.find( '>' );
393  if ( pos < ( address.size() - 2 ) ) { // this means that '>' was found (pos != npos)
394  // it is before the last char
395  address_trailer = address.substr( pos + 1 );
396  }
397  }
398  }
399  }
400  }
401  }
402 }
403 
406  // The persistency service is a address creation dispatcher istelf.
407  // The persistency service can NEVER create addresses itself.
408  // The entry point must only be provided in order to fulfill the needs of the
409  // implementing interfaces.
410  return StatusCode::FAILURE;
411 }
412 
415 
417 StatusCode PersistencySvc::getService( long service_type, IConversionSvc*& refpSvc ) {
418  refpSvc = service( service_type );
419  return refpSvc ? StatusCode::SUCCESS : StatusCode::FAILURE;
420 }
421 
424  const char* imp = service_type.c_str();
425  long len = service_type.length();
426  if ( ::strncasecmp( imp, "SICB", len ) == 0 )
427  return getService( SICB_StorageType, refpSvc );
428  else if ( ::strncasecmp( imp, "ZEBRA", len ) == 0 )
429  return getService( SICB_StorageType, refpSvc );
430  else if ( ::strncasecmp( imp, "MS Access", len ) == 0 )
431  return getService( ACCESS_StorageType, refpSvc );
432  else if ( ::strncasecmp( imp, "Microsoft Access", strlen( "Microsoft Access" ) ) == 0 )
433  return getService( ACCESS_StorageType, refpSvc );
434  else if ( ::strncasecmp( imp, "SQL Server", len ) == 0 )
435  return getService( SQLSERVER_StorageType, refpSvc );
436  else if ( ::strncasecmp( imp, "Microsoft ODBC for Oracle", len ) == 0 )
437  return getService( ORACLE_StorageType, refpSvc );
438  else if ( ::strncasecmp( imp, "Oracle ODBC", strlen( "Oracle ODBC" ) ) == 0 )
439  return getService( ORACLE_StorageType, refpSvc );
440  else if ( ::strncasecmp( imp, "Oracle OCI", strlen( "Oracle OCI" ) ) == 0 )
441  return getService( ORACLE_StorageType, refpSvc );
442  else if ( ::strncasecmp( imp, "MySQL", len ) == 0 )
443  return getService( MYSQL_StorageType, refpSvc );
444  else if ( ::strncasecmp( imp, "ROOT", len ) == 0 )
445  return getService( ROOT_StorageType, refpSvc );
446  else if ( ::strncasecmp( imp, "OBJY", len ) == 0 )
447  return getService( OBJY_StorageType, refpSvc );
448  else if ( ::strncasecmp( imp, "OBJYECTI", 7 ) == 0 )
449  return getService( OBJY_StorageType, refpSvc );
450  else if ( ::strncasecmp( imp, "POOL_ROOTKEY", 12 ) == 0 )
451  return getService( POOL_ROOTKEY_StorageType, refpSvc );
452  else if ( ::strncasecmp( imp, "POOL_ROOTTREE", 12 ) == 0 )
453  return getService( POOL_ROOTTREE_StorageType, refpSvc );
454  else if ( ::strncasecmp( imp, "POOL_ROOT", 9 ) == 0 )
455  return getService( POOL_ROOT_StorageType, refpSvc );
456  else if ( ::strncasecmp( imp, "POOL_MySQL", 8 ) == 0 )
457  return getService( POOL_MYSQL_StorageType, refpSvc );
458  else if ( ::strncasecmp( imp, "POOL_ORACLE", 8 ) == 0 )
459  return getService( POOL_ORACLE_StorageType, refpSvc );
460  else if ( ::strncasecmp( imp, "POOL_ACCESS", 8 ) == 0 )
461  return getService( POOL_ACCESS_StorageType, refpSvc );
462  else if ( ::strncasecmp( imp, "POOL", 4 ) == 0 )
463  return getService( POOL_StorageType, refpSvc );
464 
465  for ( const auto& i : m_cnvServices ) {
466  SmartIF<IService> svc( i.second.conversionSvc() );
467  if ( svc ) {
468  // Check wether this is already an active service: first check by service name
469  if ( svc->name() == service_type ) {
470  refpSvc = i.second.conversionSvc();
471  return StatusCode::SUCCESS;
472  }
473  // Check wether this is already an active service: now check by service type
474  auto instance = svc.get();
475  if ( System::typeinfoName( typeid( *instance ) ) == service_type ) {
476  refpSvc = i.second.conversionSvc();
477  return StatusCode::SUCCESS;
478  }
479  }
480  }
481  // if not, check if the service is in the list and may be requested
482  for ( const auto& i : m_svcNames.value() ) {
484  if ( itm.name() == service_type || itm.type() == service_type ) {
485  IConversionSvc* svc = service( i );
486  if ( svc ) {
487  refpSvc = svc;
488  return StatusCode::SUCCESS;
489  }
490  }
491  }
492  return StatusCode::FAILURE;
493 }
494 
496 const CLID& PersistencySvc::objType() const { return CLID_NULL; }
497 
500  m_addrCreator = this; // initialize internal pointer to IAddressCreator interface
501  // Initialize basic service
502  StatusCode status = Service::initialize();
503  if ( !status.isSuccess() ) { error() << "Error initializing Service base class." << endmsg; }
504  return status;
505 }
506 
509  // Release all workers
511  // Release references to this to avoid loops
512  m_addrCreator = nullptr;
513  return StatusCode::SUCCESS;
514 }
515 
517 bool PersistencySvc::enable( bool value ) {
518  std::swap( value, m_enable );
519  return value;
520 }
PersistencySvc::encodeAddrHdr
void encodeAddrHdr(long service_type, const CLID &clid, std::string &address) const
Retrieve string from storage type and clid.
Definition: PersistencySvc.cpp:354
IService
Definition: IService.h:28
PersistencySvc::commitOutput
StatusCode commitOutput(const std::string &output, bool do_commit) override
Commit pending output.
Definition: PersistencySvc.cpp:303
UPDATE_REP_REFS
@ UPDATE_REP_REFS
Definition: PersistencySvc.cpp:57
PersistencySvc
PersistencySvc class implementation definition.
Definition: PersistencySvc.h:60
PersistencySvc::createRep
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
Definition: PersistencySvc.cpp:135
PersistencySvc::finalize
StatusCode finalize() override
stop the service.
Definition: PersistencySvc.cpp:508
Write.stream
stream
Definition: Write.py:32
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
IAddressCreator
Definition: IAddressCreator.h:38
PersistencySvc::ServiceEntry::conversionSvc
SmartIF< IConversionSvc > & conversionSvc() const
Definition: PersistencySvc.h:83
std::string
STL class.
Gaudi::Utils::TypeNameString::name
const std::string & name() const
Definition: TypeNameString.h:49
PersistencySvc::fillRepRefs
StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
Definition: PersistencySvc.cpp:140
PersistencySvc::m_cnvDefault
SmartIF< IConversionSvc > m_cnvDefault
Default output service.
Definition: PersistencySvc.h:245
IConverter::fillRepRefs
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
PersistencySvc::updateObj
StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject) override
Implementation of IConverter: Update the transient object from the other representation.
Definition: PersistencySvc.cpp:125
PersistencySvc::conversionSvc
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
Definition: PersistencySvc.cpp:187
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
IConverter::updateRepRefs
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
CnvSvcAction
CnvSvcAction
Definition: PersistencySvc.cpp:49
CREATE_OBJ
@ CREATE_OBJ
Definition: PersistencySvc.cpp:50
gaudirun.s
string s
Definition: gaudirun.py:346
IOpaqueAddress
Definition: IOpaqueAddress.h:33
PersistencySvc::dataProvider
SmartIF< IDataProviderSvc > & dataProvider() const override
Access reference to transient datastore.
Definition: PersistencySvc.cpp:178
ACCESS_StorageType
const long ACCESS_StorageType
Definition: ClassID.h:70
std::map::find
T find(T... args)
strcasecmp.h
std::string::size
T size(T... args)
IOpaqueAddress::svcType
virtual long svcType() const =0
Retrieve service type.
MYSQL_StorageType
const long MYSQL_StorageType
Definition: ClassID.h:74
PersistencySvc::addCnvService
StatusCode addCnvService(IConversionSvc *service) override
Add a new Service.
Definition: PersistencySvc.cpp:245
PersistencySvc::decodeAddrHdr
void decodeAddrHdr(const std::string &address, long &service_type, CLID &clid, std::string &address_trailer) const
Retrieve storage type and clid from address header of string.
Definition: PersistencySvc.cpp:364
IAddressCreator::convertAddress
virtual StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress)=0
Convert an address to string form.
IConverter
Definition: IConverter.h:68
PersistencySvc::createAddress
StatusCode createAddress(long svc_type, const CLID &clid, const std::string *pars, const unsigned long *ipars, IOpaqueAddress *&refpAddress) override
Create a Generic address using explicit arguments to identify a single object.
Definition: PersistencySvc.cpp:306
PersistencySvc::removeCnvService
StatusCode removeCnvService(long type) override
Remove a Service.
Definition: PersistencySvc.cpp:276
PersistencySvc::createObj
StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
Definition: PersistencySvc.cpp:115
std::map::emplace
T emplace(T... args)
POOL_MYSQL_StorageType
const long POOL_MYSQL_StorageType
Definition: ClassID.h:82
std::stringstream
STL class.
std::istringstream
STL class.
IConverter::createObj
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:313
PersistencySvc::ServiceEntry::service
SmartIF< IService > & service() const
Definition: PersistencySvc.h:82
PersistencySvc::m_cnvServices
Services m_cnvServices
List of convermsion workers.
Definition: PersistencySvc.h:243
IDataProviderSvc.h
std::string::clear
T clear(T... args)
FILL_OBJ_REFS
@ FILL_OBJ_REFS
Definition: PersistencySvc.cpp:51
PersistencySvc::setAddressCreator
StatusCode setAddressCreator(IAddressCreator *creator) override
Set address creator facility.
Definition: PersistencySvc.cpp:405
PersistencySvc::updateRepRefs
StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an already converted object.
Definition: PersistencySvc.cpp:150
SmartIF.h
std::stol
T stol(T... args)
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:20
StatusCode
Definition: StatusCode.h:65
IConverter::createRep
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
PersistencySvc::m_dataSvc
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to datma provider service.
Definition: PersistencySvc.h:241
PersistencySvc::setDefaultCnvService
StatusCode setDefaultCnvService(long type) override
Set default service type.
Definition: PersistencySvc.cpp:289
IConverter::conversionSvc
virtual SmartIF< IConversionSvc > & conversionSvc() const =0
Get conversion service the converter is connected to.
PersistencySvc::service
SmartIF< IConversionSvc > & service(const std::string &nam)
Retrieve conversion service by name.
Definition: PersistencySvc.cpp:214
PersistencySvc::m_addrCreator
SmartIF< IAddressCreator > m_addrCreator
Pointer to the IAddressCreator interface of this, for addressCreator().
Definition: PersistencySvc.h:261
IDataSelector.h
PersistencySvc::ServiceEntry::addrCreator
SmartIF< IAddressCreator > & addrCreator() const
Definition: PersistencySvc.h:84
IOpaqueAddress.h
POOL_ROOT_StorageType
const long POOL_ROOT_StorageType
Definition: ClassID.h:78
std::string::c_str
T c_str(T... args)
CREATE_REP
@ CREATE_REP
Definition: PersistencySvc.cpp:54
POOL_ROOTKEY_StorageType
const long POOL_ROOTKEY_StorageType
Definition: ClassID.h:79
IConverter::updateObj
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
IOpaqueAddress::clID
virtual const CLID & clID() const =0
Retrieve class information from link.
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:239
PersistencySvc::converter
IConverter * converter(const CLID &clid) override
Retrieve converter from list.
Definition: PersistencySvc.cpp:211
POOL_ORACLE_StorageType
const long POOL_ORACLE_StorageType
Definition: ClassID.h:83
GaudiPython.Bindings.nullptr
nullptr
Definition: Bindings.py:87
PersistencySvc::addressCreator
SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
Definition: PersistencySvc.cpp:414
std::map::erase
T erase(T... args)
POOL_StorageType
const long POOL_StorageType
Definition: ClassID.h:77
POOL_ACCESS_StorageType
const long POOL_ACCESS_StorageType
Definition: ClassID.h:81
SmartIF< IAddressCreator >
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:18
IConversionSvc::addConverter
virtual StatusCode addConverter(IConverter *pConverter)=0
Add converter object to conversion service.
PersistencySvc::connectOutput
StatusCode connectOutput(const std::string &outputFile, const std::string &openMode) override
Connect the output file to the service with open mode.
Definition: PersistencySvc.cpp:295
PersistencySvc::ServiceEntry
Definition: PersistencySvc.h:62
ORACLE_StorageType
const long ORACLE_StorageType
Definition: ClassID.h:75
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:203
ROOT_StorageType
const long ROOT_StorageType
Definition: ClassID.h:62
PersistencySvc::m_svcNames
Gaudi::Property< std::vector< std::string > > m_svcNames
Definition: PersistencySvc.h:247
TypeNameString.h
Gaudi::Utils::TypeNameString::type
const std::string & type() const
Definition: TypeNameString.h:48
IConverter::repSvcType
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
UPDATE_REP
@ UPDATE_REP
Definition: PersistencySvc.cpp:56
IConverter.h
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
std::swap
T swap(T... args)
std::string::substr
T substr(T... args)
PersistencySvc::initialize
StatusCode initialize() override
Initialize the service.
Definition: PersistencySvc.cpp:499
gaudirun.type
type
Definition: gaudirun.py:160
make_SmartIF
SmartIF< IFace > make_SmartIF(IFace *iface)
Definition: SmartIF.h:150
UPDATE_OBJ_REFS
@ UPDATE_OBJ_REFS
Definition: PersistencySvc.cpp:53
PersistencySvc::setConversionSvc
StatusCode setConversionSvc(IConversionSvc *svc) override
Set conversion service the converter is connected to.
Definition: PersistencySvc.cpp:181
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SQLSERVER_StorageType
const long SQLSERVER_StorageType
Definition: ClassID.h:73
DataObject.h
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
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.
IConverter::updateObjRefs
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
POOL_ROOTTREE_StorageType
const long POOL_ROOTTREE_StorageType
Definition: ClassID.h:80
PersistencySvc::makeCall
StatusCode makeCall(int typ, IOpaqueAddress *&pAddress, DataObject *&pObject)
Implementation helper.
Definition: PersistencySvc.cpp:60
std::map::begin
T begin(T... args)
IConverter::updateRep
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the converted representation of a transient object.
PersistencySvc::removeConverter
StatusCode removeConverter(const CLID &clid) override
Remove converter object from conversion service (if present).
Definition: PersistencySvc.cpp:200
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:46
PersistencySvc::addConverter
StatusCode addConverter(IConverter *pConverter) override
Add converter object to conversion service.
Definition: PersistencySvc.cpp:193
DataObject
Definition: DataObject.h:40
PersistencySvc::m_enable
bool m_enable
Flag to indicate that the service is enabled.
Definition: PersistencySvc.h:258
UPDATE_OBJ
@ UPDATE_OBJ
Definition: PersistencySvc.cpp:52
PersistencySvc::updateObjRefs
StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an updated transient object.
Definition: PersistencySvc.cpp:130
PersistencySvc::updateRep
StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the converted representation of a transient object.
Definition: PersistencySvc.cpp:145
std::istringstream::str
T str(T... args)
PersistencySvc::repSvcType
long repSvcType() const override
Return default service type.
Definition: PersistencySvc.cpp:286
PersistencySvc::fillObjRefs
StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the created transient object.
Definition: PersistencySvc.cpp:120
IConverter::fillObjRefs
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
std::map::end
T end(T... args)
IDataProviderSvc
Definition: IDataProviderSvc.h:53
IOTest.end
end
Definition: IOTest.py:123
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
PersistencySvc::enable
bool enable(bool value)
Set enabled flag.
Definition: PersistencySvc.cpp:517
ISvcLocator.h
OBJY_StorageType
const long OBJY_StorageType
Definition: ClassID.h:63
PersistencySvc::convertAddress
StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress) override
Convert an address to string form.
Definition: PersistencySvc.cpp:314
SICB_StorageType
const long SICB_StorageType
Definition: ClassID.h:61
PersistencySvc::objType
const CLID & objType() const override
Retrieve the class type of objects the converter produces. (DUMMY)
Definition: PersistencySvc.cpp:496
FILL_REP_REFS
@ FILL_REP_REFS
Definition: PersistencySvc.cpp:55
MsgStream.h
PersistencySvc::setDataProvider
StatusCode setDataProvider(IDataProviderSvc *pStore) override
Define transient datastore.
Definition: PersistencySvc.cpp:171
PersistencySvc::getService
StatusCode getService(long service_type, IConversionSvc *&refpSvc) override
Retrieve conversion service identified by technology.
Definition: PersistencySvc.cpp:417
PersistencySvc.h
IConversionSvc
Definition: IConversionSvc.h:47