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