The Gaudi Framework  v30r3 (a5ef0a68)
PersistencySvc.cpp
Go to the documentation of this file.
1 //====================================================================
2 // PersistencySvc.cpp
3 //--------------------------------------------------------------------
4 //
5 // Package : System ( The LHCb Offline System)
6 //
7 // Description: implementation of the PersistencySvc
8 //
9 // Author : M.Frank
10 // History :
11 // +---------+----------------------------------------------+---------
12 // | Date | Comment | Who
13 // +---------+----------------------------------------------+---------
14 // | 29/10/98| Initial version | MF
15 // +---------+----------------------------------------------+---------
16 //
17 //====================================================================
18 #define PERSISTENCYSVC_PERSISTENCYSVC_CPP
19 
20 // Interface definitions
21 #include "GaudiKernel/DataObject.h"
22 #include "GaudiKernel/IConverter.h"
27 #include "GaudiKernel/MsgStream.h"
28 #include "GaudiKernel/SmartIF.h"
30 #include "GaudiKernel/strcasecmp.h"
31 
32 // Implementation specific definitions
33 #include "PersistencySvc.h"
34 
35 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
36 #define ON_VERBOSE if ( msgLvel( MSG::VERBOSE ) )
37 
38 #define DEBMSG ON_DEBUG debug()
39 #define VERMSG ON_VERBOSE verbose()
40 
41 // Instantiation of a static factory class used by clients to create
42 // instances of this service
44 
54 };
55 
57 {
58  if ( m_enable ) {
59  IConversionSvc* svc = nullptr;
60  switch ( typ ) {
61  case CREATE_REP:
62  case FILL_REP_REFS:
63  case UPDATE_REP:
64  case UPDATE_REP_REFS:
65  svc = m_cnvDefault;
66  break;
67  default:
68  if ( !pAddress ) return Status::INVALID_ADDRESS;
69  svc = service( pAddress->svcType() );
70  if ( !svc ) return Status::BAD_STORAGE_TYPE;
71  break;
72  }
73 
74  StatusCode status( StatusCode::FAILURE, true );
75  switch ( typ ) {
76  case CREATE_OBJ:
77  pObject = nullptr;
78  status = svc->createObj( pAddress, pObject );
79  break;
80  case FILL_OBJ_REFS:
81  status = svc->fillObjRefs( pAddress, pObject );
82  break;
83  case UPDATE_OBJ:
84  status = svc->updateObj( pAddress, pObject );
85  break;
86  case UPDATE_OBJ_REFS:
87  status = svc->updateObjRefs( pAddress, pObject );
88  break;
89  case CREATE_REP:
90  status = svc->createRep( pObject, pAddress );
91  break;
92  case FILL_REP_REFS:
93  status = svc->fillRepRefs( pAddress, pObject );
94  break;
95  case UPDATE_REP:
96  status = svc->updateRep( pAddress, pObject );
97  break;
98  case UPDATE_REP_REFS:
99  status = svc->updateRepRefs( pAddress, pObject );
100  break;
101  default:
102  status = StatusCode::FAILURE;
103  break;
104  }
105  status.ignore();
106  return status;
107  }
108  return StatusCode::SUCCESS;
109 }
110 
113 {
114  return makeCall( CREATE_OBJ, pAddr, refpObj );
115 }
116 
119 {
120  return makeCall( FILL_OBJ_REFS, pAddr, pObj );
121 }
122 
125 {
126  return makeCall( UPDATE_OBJ, pAddr, pObj );
127 }
128 
131 {
132  return makeCall( UPDATE_OBJ_REFS, pAddr, pObj );
133 }
134 
137 {
138  return makeCall( CREATE_REP, refpAddr, pObj );
139 }
140 
143 {
144  return makeCall( FILL_REP_REFS, pAddr, pObj );
145 }
146 
149 {
150  return makeCall( UPDATE_REP, pAddr, pObj );
151 }
152 
155 {
156  return makeCall( UPDATE_REP_REFS, pAddr, pObj );
157 }
158 
161 {
162  long typ = type;
163  auto it = m_cnvServices.find( typ );
164  if ( it == m_cnvServices.end() ) {
165  IConversionSvc* s = service( type );
166  if ( s ) {
167  it = m_cnvServices.find( typ );
168  if ( it != m_cnvServices.end() ) return it->second.addrCreator();
169  }
170  static SmartIF<IAddressCreator> no_creator;
171  return no_creator;
172  }
173  return it->second.addrCreator();
174 }
175 
178 {
179  m_dataSvc = pDataSvc;
180  for ( auto& i : m_cnvServices ) {
181  i.second.conversionSvc()->setDataProvider( m_dataSvc ).ignore();
182  }
183  return StatusCode( StatusCode::SUCCESS, true );
184 }
185 
188 
191 {
192  m_cnvDefault = svc;
193  return StatusCode( StatusCode::SUCCESS, true );
194 }
195 
198 
201 
204 {
205  if ( !pConverter ) return Status::NO_CONVERTER;
206  IConversionSvc* svc = service( pConverter->repSvcType() );
207  return svc ? svc->addConverter( pConverter ) : Status::BAD_STORAGE_TYPE;
208 }
209 
212 {
213  // Remove converter type from all services
214  StatusCode status = Status::NO_CONVERTER, iret = StatusCode::SUCCESS;
215  for ( auto& i : m_cnvServices ) {
216  iret = i.second.conversionSvc()->removeConverter( clid );
217  if ( iret.isSuccess() ) status = iret;
218  }
219  return status;
220 }
221 
223 IConverter* PersistencySvc::converter( const CLID& /*clid*/ ) { return nullptr; }
224 
227 {
230  [&]( Services::const_reference i ) { return i.second.service()->name() == tn.name(); } );
231  if ( it != m_cnvServices.end() ) return it->second.conversionSvc();
232 
233  auto svc = Service::service<IConversionSvc>( nam, true );
234  if ( svc && addCnvService( svc.get() ).isSuccess() ) {
235  return service( nam ); // now it is in the list
236  }
237 
238  info() << "Cannot access Conversion service:" << nam << endmsg;
239  static SmartIF<IConversionSvc> no_svc;
240  return no_svc;
241 }
242 
245 {
246  // Check wether this is already an active service
247  auto it = m_cnvServices.find( type );
248  if ( it != m_cnvServices.end() ) return it->second.conversionSvc();
249  // if not, check if the service is in the list and may be requested
250  for ( const auto& i : m_svcNames.value() ) {
251  auto& svc = service( i );
252  if ( svc && svc->repSvcType() == type ) return svc;
253  }
254  static SmartIF<IConversionSvc> no_svc;
255  return no_svc;
256 }
257 
260 {
261  if ( !servc ) return Status::BAD_STORAGE_TYPE;
262  long type = servc->repSvcType();
263  long def_typ = ( m_cnvDefault ? m_cnvDefault->repSvcType() : 0 );
264  auto it = m_cnvServices.find( type );
265  auto cnv_svc = ( it != m_cnvServices.end() ? it->second.conversionSvc() : nullptr );
266  if ( type == def_typ ) m_cnvDefault = servc;
267  if ( cnv_svc == servc ) return StatusCode::SUCCESS;
268 
269  auto iservc = make_SmartIF( servc );
270  auto icr = iservc.as<IAddressCreator>();
271  if ( icr ) {
272  auto isvc = iservc.as<IService>();
273  if ( isvc ) {
274  if ( cnv_svc ) removeCnvService( type ).ignore();
275  auto p = m_cnvServices.emplace( type, ServiceEntry( type, isvc, iservc, icr ) );
276  if ( !p.second ) {
277  info() << "Cannot add Conversion service of type " << isvc->name() << endmsg;
278  return StatusCode::FAILURE;
279  }
280  info() << "Added successfully Conversion service:" << isvc->name() << endmsg;
281  iservc->setAddressCreator( this ).ignore();
282  iservc->setDataProvider( m_dataSvc ).ignore();
283  return StatusCode::SUCCESS;
284  }
285  }
286  info() << "Cannot add Conversion service of type " << type << endmsg;
287  return StatusCode::FAILURE;
288 }
289 
292 {
293  auto it = m_cnvServices.find( svctype );
294  if ( it == m_cnvServices.end() ) return Status::BAD_STORAGE_TYPE;
295  it->second.service()->release();
296  it->second.addrCreator()->release();
297  m_cnvServices.erase( it );
298  return StatusCode::SUCCESS;
299 }
300 
303 
306 {
307  m_cnvDefault = service( type );
308  return StatusCode::SUCCESS;
309 }
310 
312 StatusCode PersistencySvc::connectOutput( const std::string& outputFile, const std::string& /* openMode */ )
313 {
314  return connectOutput( outputFile );
315 }
316 
319 
322 
324 StatusCode PersistencySvc::createAddress( long svc_type, const CLID& clid, const std::string* pars,
325  const unsigned long* ipars, IOpaqueAddress*& refpAddress )
326 {
327  refpAddress = nullptr;
328  IAddressCreator* svc = addressCreator( svc_type );
329  return svc ? svc->createAddress( svc_type, clid, pars, ipars, refpAddress ) : Status::BAD_STORAGE_TYPE;
330 }
331 
334 {
335  // Assumuption is that the Persistency service prepends a header
336  // and requests the conversion service refered to by the service
337  // type to encode the rest
338  long svc_type = 0;
339  CLID clid = 0;
340  if ( pAddress ) {
341  svc_type = pAddress->svcType();
342  clid = pAddress->clID();
343  }
344  IAddressCreator* svc = addressCreator( svc_type );
345  StatusCode status = Status::BAD_STORAGE_TYPE; // Preset error
346  refAddress.clear();
347 
348  if ( svc ) {
349  // Found service, set header
350  encodeAddrHdr( svc_type, clid, refAddress );
351  std::string address;
352  // Get rest of address from conversion service
353  status = svc->convertAddress( pAddress, address );
354  refAddress += address;
355  }
356  return status;
357 }
358 
360 StatusCode PersistencySvc::createAddress( long /* svc_type */, const CLID& /* clid */, const std::string& refAddress,
361  IOpaqueAddress*& refpAddress )
362 {
363  // Assumption is that the Persistency service decodes that header
364  // and requests the conversion service referred to by the service
365  // type to decode the rest
366  long new_svc_type = 0;
367  CLID new_clid = 0;
368  std::string address_trailer;
369  decodeAddrHdr( refAddress, new_svc_type, new_clid, address_trailer );
370  IAddressCreator* svc = addressCreator( new_svc_type );
371  return svc ? svc->createAddress( new_svc_type, new_clid, address_trailer, refpAddress ) : Status::BAD_STORAGE_TYPE;
372 }
373 
375 void PersistencySvc::encodeAddrHdr( long service_type, const CLID& clid, std::string& address ) const
376 {
377  // For address header, use xml-style format of
378  // <addrhdr service_type="xxx" clid="yyy" />
379  std::stringstream stream;
380  int svctyp = service_type; // must put int into stream, not char
381  stream << "<address_header service_type=\"" << svctyp << "\" clid=\"" << clid << "\" /> ";
382  address = stream.str();
383 }
384 
386 void PersistencySvc::decodeAddrHdr( const std::string& address, long& service_type, CLID& clid,
387  std::string& address_trailer ) const
388 {
389  // For address header, use xml-style format of
390  // <address_header service_type="xxx" clid="yyy" />
391  service_type = 0;
392  clid = 0;
393  address_trailer.clear();
394 
395  // Check for address_header tag
396  size_t pos = address.find( "<address_header" );
397  if ( std::string::npos != pos ) {
398  // Get service_type
399  pos = address.find( "service_type=\"" );
400  if ( std::string::npos != pos ) {
401  pos += 14;
402  size_t end = address.find( '"', pos );
403  if ( std::string::npos != end ) {
404  service_type = std::stol( address.substr( pos, end - pos ) );
405  // Get clid
406  pos = address.find( "clid=\"" );
407  if ( std::string::npos != pos ) {
408  pos += 6;
409  end = address.find( '\"', pos );
410  if ( std::string::npos != end ) {
411  std::istringstream str;
412  str.str( address.substr( pos, end - pos ) );
413  str >> clid;
414  // Get trailer_address
415  pos = address.find( '>' );
416  if ( pos < ( address.size() - 2 ) ) { // this means that '>' was found (pos != npos)
417  // it is before the last char
418  address_trailer = address.substr( pos + 1 );
419  }
420  }
421  }
422  }
423  }
424  }
425 }
426 
429 {
430  // The persistency service is a address creation dispatcher istelf.
431  // The persistency service can NEVER create addresses itself.
432  // The entry point must only be provided in order to fulfill the needs of the
433  // implementing interfaces.
434  return StatusCode::FAILURE;
435 }
436 
439 
441 StatusCode PersistencySvc::getService( long service_type, IConversionSvc*& refpSvc )
442 {
443  refpSvc = service( service_type );
444  return refpSvc ? StatusCode::SUCCESS : StatusCode::FAILURE;
445 }
446 
449 {
450  const char* imp = service_type.c_str();
451  long len = service_type.length();
452  if (::strncasecmp( imp, "SICB", len ) == 0 )
453  return getService( SICB_StorageType, refpSvc );
454  else if (::strncasecmp( imp, "ZEBRA", len ) == 0 )
455  return getService( SICB_StorageType, refpSvc );
456  else if (::strncasecmp( imp, "MS Access", len ) == 0 )
457  return getService( ACCESS_StorageType, refpSvc );
458  else if (::strncasecmp( imp, "Microsoft Access", strlen( "Microsoft Access" ) ) == 0 )
459  return getService( ACCESS_StorageType, refpSvc );
460  else if (::strncasecmp( imp, "SQL Server", len ) == 0 )
461  return getService( SQLSERVER_StorageType, refpSvc );
462  else if (::strncasecmp( imp, "Microsoft ODBC for Oracle", len ) == 0 )
463  return getService( ORACLE_StorageType, refpSvc );
464  else if (::strncasecmp( imp, "Oracle ODBC", strlen( "Oracle ODBC" ) ) == 0 )
465  return getService( ORACLE_StorageType, refpSvc );
466  else if (::strncasecmp( imp, "Oracle OCI", strlen( "Oracle OCI" ) ) == 0 )
467  return getService( ORACLE_StorageType, refpSvc );
468  else if (::strncasecmp( imp, "MySQL", len ) == 0 )
469  return getService( MYSQL_StorageType, refpSvc );
470  else if (::strncasecmp( imp, "ROOT", len ) == 0 )
471  return getService( ROOT_StorageType, refpSvc );
472  else if (::strncasecmp( imp, "OBJY", len ) == 0 )
473  return getService( OBJY_StorageType, refpSvc );
474  else if (::strncasecmp( imp, "OBJYECTI", 7 ) == 0 )
475  return getService( OBJY_StorageType, refpSvc );
476  else if (::strncasecmp( imp, "POOL_ROOTKEY", 12 ) == 0 )
477  return getService( POOL_ROOTKEY_StorageType, refpSvc );
478  else if (::strncasecmp( imp, "POOL_ROOTTREE", 12 ) == 0 )
479  return getService( POOL_ROOTTREE_StorageType, refpSvc );
480  else if (::strncasecmp( imp, "POOL_ROOT", 9 ) == 0 )
481  return getService( POOL_ROOT_StorageType, refpSvc );
482  else if (::strncasecmp( imp, "POOL_MySQL", 8 ) == 0 )
483  return getService( POOL_MYSQL_StorageType, refpSvc );
484  else if (::strncasecmp( imp, "POOL_ORACLE", 8 ) == 0 )
485  return getService( POOL_ORACLE_StorageType, refpSvc );
486  else if (::strncasecmp( imp, "POOL_ACCESS", 8 ) == 0 )
487  return getService( POOL_ACCESS_StorageType, refpSvc );
488  else if (::strncasecmp( imp, "POOL", 4 ) == 0 )
489  return getService( POOL_StorageType, refpSvc );
490 
491  for ( const auto& i : m_cnvServices ) {
492  SmartIF<IService> svc( i.second.conversionSvc() );
493  if ( svc ) {
494  // Check wether this is already an active service: first check by service name
495  if ( svc->name() == service_type ) {
496  refpSvc = i.second.conversionSvc();
497  return StatusCode::SUCCESS;
498  }
499  // Check wether this is already an active service: now check by service type
500  auto instance = svc.get();
501  if ( System::typeinfoName( typeid( *instance ) ) == service_type ) {
502  refpSvc = i.second.conversionSvc();
503  return StatusCode::SUCCESS;
504  }
505  }
506  }
507  // if not, check if the service is in the list and may be requested
508  for ( const auto& i : m_svcNames.value() ) {
510  if ( itm.name() == service_type || itm.type() == service_type ) {
511  IConversionSvc* svc = service( i );
512  if ( svc ) {
513  refpSvc = svc;
514  return StatusCode::SUCCESS;
515  }
516  }
517  }
518  return StatusCode::FAILURE;
519 }
520 
522 const CLID& PersistencySvc::objType() const { return CLID_NULL; }
523 
526 {
527  m_addrCreator = this; // initialize internal pointer to IAddressCreator interface
528  // Initialize basic service
529  StatusCode status = Service::initialize();
530  if ( UNLIKELY( !status.isSuccess() ) ) {
531  error() << "Error initializing Service base class." << endmsg;
532  }
533  return status;
534 }
535 
538 {
539  // Release all workers
541  // Release references to this to avoid loops
542  m_addrCreator = nullptr;
543  return StatusCode::SUCCESS;
544 }
545 
547 
549 bool PersistencySvc::enable( bool value )
550 {
551  std::swap( value, m_enable );
552  return value;
553 }
554 
557 {
558  m_svcNames.declareUpdateHandler( &PersistencySvc::svcNamesHandler, this );
559 }
SmartIF< IAddressCreator > m_addrCreator
Pointer to the IAddressCreator interface of this, for addressCreator().
#define UNLIKELY(x)
Definition: Kernel.h:122
SmartIF< IConversionSvc > & service(const std::string &nam)
Retrieve conversion service by name.
constexpr static const auto FAILURE
Definition: StatusCode.h:88
SmartIF< IConversionSvc > & conversionSvc() const
SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
StatusCode initialize() override
Definition: Service.cpp:63
SmartIF< IAddressCreator > & addrCreator() const
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
The data converters are responsible to translate data from one representation into another...
Definition: IConverter.h:58
virtual const CLID & clID() const =0
Retrieve class information from link.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:288
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
#define DEBMSG
StatusCode initialize() override
Initialize the service.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode connectOutput(const std::string &outputFile, const std::string &openMode) override
Connect the output file to the service with open mode.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:332
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.
T swap(T...args)
Gaudi::Property< std::vector< std::string > > m_svcNames
bool isSuccess() const
Definition: StatusCode.h:287
const long ACCESS_StorageType
Definition: ClassID.h:60
IAddressCreator interface definition.
SmartIF< IService > & service() const
bool m_enable
Flag to indicate that the service is enabled.
StatusCode setConversionSvc(IConversionSvc *svc) override
Set conversion service the converter is connected to.
virtual StatusCode addConverter(IConverter *pConverter)=0
Add converter object to conversion service.
StatusCode makeCall(int typ, IOpaqueAddress *&pAddress, DataObject *&pObject)
Implementation helper.
T end(T...args)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
const long MYSQL_StorageType
Definition: ClassID.h:64
Data provider interface definition.
StatusCode removeConverter(const CLID &clid) override
Remove converter object from conversion service (if present).
PersistencySvc(const std::string &name, ISvcLocator *svc)
Standard Constructor.
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
const long POOL_MYSQL_StorageType
Definition: ClassID.h:72
StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the converted representation of a transient object.
StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an updated transient object.
StatusCode addConverter(IConverter *pConverter) override
Add converter object to conversion service.
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress) override
Convert an address to string form.
STL class.
const long POOL_ROOTKEY_StorageType
Definition: ClassID.h:69
#define DECLARE_COMPONENT(type)
StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the created transient object.
bool enable(bool value)
Set enabled flag.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode setDataProvider(IDataProviderSvc *pStore) override
Define transient datastore.
const long POOL_ACCESS_StorageType
Definition: ClassID.h:71
Helper class to parse a string of format "type/name".
void encodeAddrHdr(long service_type, const CLID &clid, std::string &address) const
Retrieve string from storage type and clid.
General service interface definition.
Definition: IService.h:18
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
StatusCode finalize() override
stop the service.
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
StatusCode getService(long service_type, IConversionSvc *&refpSvc) override
Retrieve conversion service identified by technology.
T erase(T...args)
CnvSvcAction
const long POOL_ORACLE_StorageType
Definition: ClassID.h:73
SmartIF< IConversionSvc > m_cnvDefault
Default output service.
StatusCode commitOutput(const std::string &output, bool do_commit) override
Commit pending output.
T str(T...args)
PersistencySvc class implementation definition.
const long ROOT_StorageType
Definition: ClassID.h:52
StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
virtual long svcType() const =0
Retrieve service type.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
SmartIF< IDataProviderSvc > & dataProvider() const override
Access reference to transient datastore.
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the converted representation of a transient object.
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
T clear(T...args)
const long ORACLE_StorageType
Definition: ClassID.h:65
const long POOL_ROOT_StorageType
Definition: ClassID.h:68
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
StatusCode addCnvService(IConversionSvc *service) override
Add a new Service.
StatusCode removeCnvService(long type) override
Remove a Service.
StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject) override
Implementation of IConverter: Update the transient object from the other representation.
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.
const long POOL_StorageType
Definition: ClassID.h:67
T find(T...args)
T size(T...args)
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
void svcNamesHandler(Gaudi::Details::PropertyBase &theProp)
Handlers for Service Names Property.
const long POOL_ROOTTREE_StorageType
Definition: ClassID.h:70
virtual StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress)=0
Convert an address to string form.
T begin(T...args)
StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
const std::string & type() const
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:165
T c_str(T...args)
Services m_cnvServices
List of convermsion workers.
T emplace(T...args)
string s
Definition: gaudirun.py:253
StatusCode setAddressCreator(IAddressCreator *creator) override
Set address creator facility.
T substr(T...args)
SmartIF< IFace > make_SmartIF(IFace *iface)
Definition: SmartIF.h:152
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.
const long SQLSERVER_StorageType
Definition: ClassID.h:63
const std::string & name() const
virtual SmartIF< IConversionSvc > & conversionSvc() const =0
Get conversion service the converter is connected to.
Opaque address interface definition.
const long OBJY_StorageType
Definition: ClassID.h:53
StatusCode setDefaultCnvService(long type) override
Set default service type.
const long SICB_StorageType
Definition: ClassID.h:51
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
const CLID & objType() const override
Retrieve the class type of objects the converter produces. (DUMMY)
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an already converted object.
T stol(T...args)
long repSvcType() const override
Return default service type.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to datma provider service.
IConverter * converter(const CLID &clid) override
Retrieve converter from list.