13 #define GAUDISVC_EVENTSELECTOR_EVENTSELECTORDATASTREAM_CPP 1
15 #include "GaudiKernel/AttribStringParser.h"
16 #include "GaudiKernel/IService.h"
17 #include "GaudiKernel/ISvcLocator.h"
18 #include "GaudiKernel/IConversionSvc.h"
19 #include "GaudiKernel/IDataManagerSvc.h"
20 #include "GaudiKernel/IPersistencySvc.h"
21 #include "GaudiKernel/PropertyMgr.h"
22 #include "GaudiKernel/MsgStream.h"
23 #include "GaudiKernel/EventSelectorDataStream.h"
28 return s <<
"Stream:" << obj.
name() <<
" Def:" << obj.
definition();
33 return s <<
"Stream:" << obj.
name() <<
" Def:" << obj.
definition();
38 : m_name{ std::move(nam) }, m_definition{ std::move(def) }, m_pSvcLocator(svcloc)
64 std::string auth, dbtyp, collsvc,
item, crit,
sel, svc, stmt;
65 std::string cnt =
"/Event";
66 std::string db =
"<Unknown>";
70 std::cout <<
"ERROR: Unable to localize interface IDataManagerSvc from service EventDataSvc"
75 cnt = eds->rootName();
80 using Parser = Gaudi::Utils::AttribStringParser;
83 switch( ::
toupper(attrib.tag[0]) ) {
85 auth = std::move(attrib.value);
92 hash = attrib.value.find(
'#');
94 cnt = attrib.value.substr(0, hash);
95 item = attrib.value.substr(hash + 1);
98 cnt = std::move(attrib.value);
107 switch( ::
toupper(attrib.tag[1]) ) {
113 stmt = std::move(attrib.value);
125 switch( ::
toupper(attrib.tag[1]) ) {
127 dbtyp = std::move(attrib.value);
134 switch( ::
toupper(attrib.tag[1]) ) {
136 sel = std::move(attrib.value);
139 svc = std::move(attrib.value);
155 else if ( dbtyp.compare(0,4,
"POOL") == 0 ) {
158 else if ( svc.empty() ) {
165 if ( svc.empty() && !dbtyp.empty() ) {
169 status = ipers->getService(dbtyp, icnvSvc);
172 if ( isvc ) svc = isvc->name();
184 if ( !isData && !collsvc.empty() ) {
Definition of the MsgStream class used to transmit messages.
bool m_initialized
Initialization state.
const std::string & name() const
Retrieve stream name.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
MsgStream & operator<<(MsgStream &s, const EventSelectorDataStream &obj)
Output friend for MsgStream.
const std::string & name() const
property name
The Event Selector Interface.
bool isSuccess() const
Test for a status code of SUCCESS.
auto begin(reverse_wrapper< T > &w)
std::string m_criteria
Criteria.
std::string m_selectorType
Event selector type.
StringProperty * property(const std::string &nam)
Allow access to individual properties by name.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
virtual StatusCode initialize()
Parse input criteria.
ISvcLocator * m_pSvcLocator
Reference to service locator.
auto end(reverse_wrapper< T > &w)
This class is used for returning status codes from appropriate routines.
SmartIF< IEvtSelector > m_pSelector
Pointer to valid selector.
virtual StatusCode finalize()
Finalize stream and release resources.
std::string m_definition
Definition string.
const std::string & definition() const
Retrieve definition string.
Properties m_properties
Properties vector.
Definition of class EventSelectorDataStream.
Data persistency service interface.
EventSelectorDataStream(std::string nam, std::string def, ISvcLocator *svcloc)
Standard Constructor.
std::string m_dbName
String with name of the db as parsed.
void toupper(std::string &s)
virtual void setSelector(IEvtSelector *pSelector)
Attach event selector object.