22 #define GAUDISVC_TAGCOLLECTIONSVC_CPP
25 #include "GaudiKernel/SmartIF.h"
26 #include "GaudiKernel/AttribStringParser.h"
27 #include "GaudiKernel/DataObject.h"
28 #include "GaudiKernel/ObjectFactory.h"
29 #include "GaudiKernel/GenericAddress.h"
31 #include "GaudiKernel/IProperty.h"
32 #include "GaudiKernel/ISvcManager.h"
33 #include "GaudiKernel/ISvcLocator.h"
34 #include "GaudiKernel/IConversionSvc.h"
36 #include "GaudiKernel/MsgStream.h"
37 #include "GaudiKernel/Property.h"
56 StatusCode status = findObject(m_rootName, pO);
58 status = INVALID_ROOT;
61 std::vector<Prop> props;
62 long loc = ident.find(
" ");
63 std::string filename, svc =
"DbCnvSvc";
64 logname = ident.substr(0,loc);
65 using Parser = Gaudi::Utils::AttribStringParser;
68 for (
auto attrib: Parser(ident.substr(loc + 1))) {
69 switch( ::
toupper(attrib.tag[0]) ) {
71 props.emplace_back(
"Server", attrib.value);
75 filename = std::move(attrib.value);
78 switch( ::
toupper(attrib.value[0]) ) {
81 case 'W': typ =
'N';
break;
82 case 'U': typ =
'U';
break;
85 switch( ::
toupper(attrib.value[2]) ) {
86 case 'C': typ =
'R';
break;
88 default: typ =
'O';
break;
91 default: typ = 0;
break;
95 switch( ::
toupper(attrib.tag[1]) ) {
96 case 'V': svc = std::move(attrib.value);
break;
98 switch(::
toupper(attrib.value[0])) {
100 props.emplace_back(
"ShareFiles", attrib.value);
107 switch(::
toupper(attrib.value[0])) {
109 svc =
"HbookCnv::ConvSvc";
112 props.emplace_back(
"DbType", attrib.value);
113 svc =
"PoolDbCnvSvc";
116 props.emplace_back(
"DbType", attrib.value);
122 props.emplace_back( attrib.tag, attrib.value);
139 log <<
MSG::ERROR <<
"Cannot add " << ident <<
" invalid filename!" <<
endmsg;
145 const std::string& typ,
146 const std::vector<Prop>& props,
161 for (
const auto& p : props ) {
166 if ( status.isSuccess() ) {
167 status = icsvc->setDataProvider(
this);
168 if ( status.isSuccess() ) {
Definition of the MsgStream class used to transmit messages.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
The ISvcManager is the interface implemented by the Service Factory in the Application Manager to sup...
bool isSuccess() const
Test for a status code of SUCCESS.
IRegistry * registry() const
Get pointer to Registry.
virtual StatusCode sysInitialize()=0
Initialize Service.
StatusCode connect(const std::string &ident, std::string &logname) override
Add file to list I/O list.
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Helper class to parse a string of format "type/name".
Gaudi tag collection service definition.
#define DECLARE_COMPONENT(type)
virtual long repSvcType() const =0
Retrieve the class type of the data store the converter uses.
This class is used for returning status codes from appropriate routines.
virtual StatusCode setProperty(const Property &p)=0
Set the property by property.
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
The IProperty is the basic interface for all components which have properties that can be set or get...
StatusCode attachTuple(const std::string &filename, const std::string &logname, const char typ, const long t)
Attach output/input file.
A DataObject is the base class of any identifiable object on any data store.
void toupper(std::string &s)
virtual StatusCode createService(const std::string &nam, const std::string &typ, const std::vector< Prop > &props, IConversionSvc *&pSvc)
Create conversion service.
Connections m_connections
Container of connection points.