48      if ( !pAddress ) 
return Status::INVALID_ADDRESS;
 
   50      if ( !svc ) 
return Status::BAD_STORAGE_TYPE;
 
   58      status  = svc->
createObj( pAddress, pObject );
 
   64      status = svc->
updateObj( pAddress, pObject );
 
   70      status = svc->
createRep( pObject, pAddress );
 
   76      status = svc->
updateRep( pAddress, pObject );
 
 
  141      if ( it != 
m_cnvServices.end() ) 
return it->second.addrCreator();
 
  146  return it->second.addrCreator();
 
 
  174  if ( !pConverter ) 
return Status::NO_CONVERTER;
 
  176  return svc ? svc->
addConverter( pConverter ) : Status::BAD_STORAGE_TYPE;
 
 
  185    iret = i.second.conversionSvc()->removeConverter( clid );
 
  186    if ( iret.isSuccess() ) status = iret;
 
 
  201                          [&]( Services::const_reference i ) { return i.second.service()->name() == tn.name(); } );
 
  202  if ( it != 
m_cnvServices.end() ) 
return it->second.conversionSvc();
 
  209  error() << 
"Cannot access Conversion service " << nam << 
endmsg;
 
 
  219  if ( it != 
m_cnvServices.end() ) 
return it->second.conversionSvc();
 
  223    if ( svc && svc->repSvcType() == type ) 
return svc;
 
 
  232  if ( !servc ) 
return Status::BAD_STORAGE_TYPE;
 
  236  auto cnv_svc = ( it != 
m_cnvServices.end() ? it->second.conversionSvc() : 
nullptr );
 
  248        error() << 
"Cannot add Conversion service " << isvc->name() << 
endmsg;
 
  251      info() << 
"Added successfully Conversion service " << isvc->name() << 
endmsg;
 
  252      iservc->setAddressCreator( 
this ).ignore();
 
  253      iservc->setDataProvider( 
m_dataSvc ).ignore();
 
  257  error() << 
"Cannot add Conversion service for type " << type << 
endmsg;
 
 
  266  if ( it == 
m_cnvServices.end() ) 
return Status::BAD_STORAGE_TYPE;
 
  267  it->second.service()->release();
 
  268  it->second.addrCreator()->release();
 
 
  296  refpAddress          = 
nullptr;
 
  298  return svc ? svc->
createAddress( svc_type, clid, pars, ipars, refpAddress ) : Status::BAD_STORAGE_TYPE;
 
 
  309    svc_type = pAddress->
svcType();
 
  310    clid     = pAddress->
clID();
 
  322    refAddress += address;
 
 
  333  long        new_svc_type = 0;
 
  335  std::string address_trailer;
 
  336  decodeAddrHdr( refAddress, new_svc_type, new_clid, address_trailer );
 
  338  return svc ? svc->
createAddress( new_svc_type, new_clid, address_trailer, refpAddress ) : Status::BAD_STORAGE_TYPE;
 
 
  345  std::stringstream stream;
 
  346  int               svctyp = service_type; 
 
  347  stream << 
"<address_header service_type=\"" << svctyp << 
"\" clid=\"" << clid << 
"\" /> ";
 
  348  address = stream.str();
 
 
  353                                    std::string& address_trailer )
 const {
 
  358  address_trailer.clear();
 
  361  size_t pos = address.find( 
"<address_header" );
 
  362  if ( std::string::npos != pos ) {
 
  364    pos = address.find( 
"service_type=\"" );
 
  365    if ( std::string::npos != pos ) {
 
  367      size_t end = address.find( 
'"', pos );
 
  368      if ( std::string::npos != end ) {
 
  369        service_type = std::stol( address.substr( pos, end - pos ) );
 
  371        pos = address.find( 
"clid=\"" );
 
  372        if ( std::string::npos != pos ) {
 
  374          end = address.find( 
'\"', pos );
 
  375          if ( std::string::npos != end ) {
 
  376            std::istringstream str;
 
  377            str.str( address.substr( pos, end - pos ) );
 
  380            pos = address.find( 
'>' );
 
  381            if ( pos < ( address.size() - 2 ) ) { 
 
  383              address_trailer = address.substr( pos + 1 );
 
 
  406  refpSvc = 
service( service_type );
 
 
  412  const char* imp = service_type.c_str();
 
  413  long        len = service_type.length();
 
  414  if ( ::strncasecmp( imp, 
"SICB", len ) == 0 )
 
  416  else if ( ::strncasecmp( imp, 
"ZEBRA", len ) == 0 )
 
  418  else if ( ::strncasecmp( imp, 
"MS Access", len ) == 0 )
 
  420  else if ( ::strncasecmp( imp, 
"Microsoft Access", strlen( 
"Microsoft Access" ) ) == 0 )
 
  422  else if ( ::strncasecmp( imp, 
"SQL Server", len ) == 0 )
 
  424  else if ( ::strncasecmp( imp, 
"Microsoft ODBC for Oracle", len ) == 0 )
 
  426  else if ( ::strncasecmp( imp, 
"Oracle ODBC", strlen( 
"Oracle ODBC" ) ) == 0 )
 
  428  else if ( ::strncasecmp( imp, 
"Oracle OCI", strlen( 
"Oracle OCI" ) ) == 0 )
 
  430  else if ( ::strncasecmp( imp, 
"MySQL", len ) == 0 )
 
  432  else if ( ::strncasecmp( imp, 
"ROOT", len ) == 0 )
 
  434  else if ( ::strncasecmp( imp, 
"OBJY", len ) == 0 )
 
  436  else if ( ::strncasecmp( imp, 
"OBJYECTI", 7 ) == 0 )
 
  438  else if ( ::strncasecmp( imp, 
"POOL_ROOTKEY", 12 ) == 0 )
 
  440  else if ( ::strncasecmp( imp, 
"POOL_ROOTTREE", 12 ) == 0 )
 
  442  else if ( ::strncasecmp( imp, 
"POOL_ROOT", 9 ) == 0 )
 
  444  else if ( ::strncasecmp( imp, 
"POOL_MySQL", 8 ) == 0 )
 
  446  else if ( ::strncasecmp( imp, 
"POOL_ORACLE", 8 ) == 0 )
 
  448  else if ( ::strncasecmp( imp, 
"POOL_ACCESS", 8 ) == 0 )
 
  450  else if ( ::strncasecmp( imp, 
"POOL", 4 ) == 0 )
 
  458      if ( svc->name() == service_type ) {
 
  463      auto instance = svc.
get();
 
  473    if ( itm.
name() == service_type || itm.
type() == service_type ) {
 
 
const long POOL_MYSQL_StorageType
const long POOL_ORACLE_StorageType
const long POOL_ROOTKEY_StorageType
const long ORACLE_StorageType
const long MYSQL_StorageType
const long OBJY_StorageType
const long POOL_StorageType
const long SQLSERVER_StorageType
const long ACCESS_StorageType
unsigned int CLID
Class ID definition.
const long POOL_ROOT_StorageType
const long POOL_ACCESS_StorageType
const long SICB_StorageType
const long POOL_ROOTTREE_StorageType
const long ROOT_StorageType
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
SmartIF< IFace > make_SmartIF(IFace *iface)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
A DataObject is the base class of any identifiable object on any data store.
Helper class to parse a string of format "type/name".
const std::string & type() const
const std::string & name() const
IAddressCreator interface definition.
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.
virtual StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress)=0
Convert an address to string form.
virtual StatusCode addConverter(IConverter *pConverter)=0
Add converter object to conversion service.
The data converters are responsible to translate data from one representation into another.
virtual StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an already converted object.
virtual StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the created transient object.
virtual StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject)=0
Update the transient object from the other representation.
virtual StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject)=0
Create the transient representation of an object.
virtual SmartIF< IConversionSvc > & conversionSvc() const =0
Get conversion service the converter is connected to.
virtual StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the converted representation of a transient object.
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
virtual StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Update the references of an updated transient object.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
Data provider interface definition.
Opaque address interface definition.
virtual long svcType() const =0
Retrieve service type.
virtual const CLID & clID() const =0
Retrieve class information from link.
General service interface definition.
PersistencySvc class implementation definition.
bool m_enable
Flag to indicate that the service is enabled.
StatusCode setConversionSvc(IConversionSvc *svc) override
Set conversion service the converter is connected to.
StatusCode connectOutput(const std::string &outputFile, const std::string &openMode) override
Connect the output file to the service with open mode.
long repSvcType() const override
Return default service type.
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.
StatusCode createObj(IOpaqueAddress *pAddress, DataObject *&refpObject) override
Implementation of IConverter: Create the transient representation of an object.
Gaudi::Property< std::vector< std::string > > m_svcNames
StatusCode setAddressCreator(IAddressCreator *creator) override
Set address creator facility.
StatusCode setDefaultCnvService(long type) override
Set default service type.
StatusCode updateRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an already converted object.
void encodeAddrHdr(long service_type, const CLID &clid, std::string &address) const
Retrieve string from storage type and clid.
SmartIF< IDataProviderSvc > & dataProvider() const override
Access reference to transient datastore.
StatusCode commitOutput(const std::string &output, bool do_commit) override
Commit pending output.
SmartIF< IConversionSvc > & conversionSvc() const override
Get conversion service the converter is connected to.
const CLID & objType() const override
Retrieve the class type of objects the converter produces. (DUMMY)
std::recursive_mutex m_servicesMutex
Mutex to protect accesses to m_cnvServices.
StatusCode updateObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the references of an updated transient object.
StatusCode convertAddress(const IOpaqueAddress *pAddress, std::string &refAddress) override
Convert an address to string form.
SmartIF< IConversionSvc > m_cnvDefault
Default output service.
SmartIF< IAddressCreator > m_addrCreator
Pointer to the IAddressCreator interface of this, for addressCreator().
StatusCode addConverter(IConverter *pConverter) override
Add converter object to conversion service.
StatusCode fillObjRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the created transient object.
StatusCode removeCnvService(long type) override
Remove a Service.
StatusCode setDataProvider(IDataProviderSvc *pStore) override
Define transient datastore.
StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Resolve the references of the converted object.
IConverter * converter(const CLID &clid) override
Retrieve converter from list.
StatusCode addCnvService(IConversionSvc *service) override
Add a new Service.
StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress) override
Implementation of IConverter: Convert the transient object to the requested representation.
StatusCode updateRep(IOpaqueAddress *pAddress, DataObject *pObject) override
Implementation of IConverter: Update the converted representation of a transient object.
Services m_cnvServices
List of conversion workers.
SmartIF< IAddressCreator > & addressCreator() const override
Retrieve address creator facility.
StatusCode initialize() override
Initialize the service.
bool enable(bool value)
Set enabled flag.
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.
StatusCode makeCall(int typ, IOpaqueAddress *&pAddress, DataObject *&pObject)
Implementation helper.
StatusCode removeConverter(const CLID &clid) override
Remove converter object from conversion service (if present).
StatusCode finalize() override
stop the service.
StatusCode updateObj(IOpaqueAddress *pAddress, DataObject *refpObject) override
Implementation of IConverter: Update the transient object from the other representation.
SmartIF< IConversionSvc > & service(const std::string &nam)
Retrieve conversion service by name.
StatusCode getService(long service_type, IConversionSvc *&refpSvc) override
Retrieve conversion service identified by technology.
SmartIF< IDataProviderSvc > m_dataSvc
Pointer to data provider service.
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
StatusCode initialize() override
Small smart pointer class with automatic reference counting for IInterface.
TYPE * get() const
Get interface pointer.
This class is used for returning status codes from appropriate routines.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
void swap(GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &left, GaudiUtils::VectorMap< KEY, VALUE, KEYCOMPARE, ALLOCATOR > &right)
the definition of specialized algorithm for swapping