The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
DataStreamTool Class Reference

#include <GaudiKernel/DataStreamTool.h>

Inheritance diagram for DataStreamTool:
Collaboration diagram for DataStreamTool:

Public Types

typedef std::vector< EventSelectorDataStream * > Streams
 
typedef std::vector< Gaudi::Property< std::string > > Properties
 
- Public Types inherited from extends< AlgTool, IDataStreamTool >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from AlgTool
using Factory = Gaudi::PluginService::Factory<IAlgTool*( const std::string&, const std::string&, const IInterface* )>
 
- Public Types inherited from extends< PropertyHolder< CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > > >, IDataHandleHolder >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > > >
using PropertyHolderImpl
 Typedef used to refer to this class from derived classes, as in.
 
- Public Types inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
using base_class
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 

Public Member Functions

StatusCode initialize () override
 
StatusCode finalize () override
 
StatusCode initializeStream (EventSelectorDataStream *) override
 Initialize newly opened stream.
 
StatusCode finalizeStream (EventSelectorDataStream *) override
 Finalize no longer needed stream.
 
StatusCode getNextStream (const EventSelectorDataStream *&, size_type &) override
 
StatusCode getPreviousStream (const EventSelectorDataStream *&, size_type &) override
 
StatusCode addStream (const std::string &) override
 
StatusCode addStreams (const StreamSpecs &) override
 
StatusCode eraseStream (const std::string &) override
 
EventSelectorDataStreamgetStream (const std::string &) override
 Retrieve stream by name.
 
EventSelectorDataStreamgetStream (size_type) override
 
EventSelectorDataStreamlastStream () override
 
size_type size () override
 
StatusCode clear () override
 
virtual StreamsgetStreams ()
 
virtual Streams::iterator beginOfStreams ()
 
virtual Streams::iterator endOfStreams ()
 
- Public Member Functions inherited from extends< AlgTool, IDataStreamTool >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from AlgTool
StatusCode queryInterface (const InterfaceID &riid, void **ppvUnknown) override
 Query for a given interface.
 
void const * i_cast (const InterfaceID &riid) const override
 
const std::string & name () const override
 Retrieve full identifying name of the concrete tool object.
 
const std::string & type () const override
 Retrieve type (concrete class) of the sub-algtool.
 
const IInterfaceparent () const override
 Retrieve parent of the sub-algtool.
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode sysInitialize () override
 Initialize AlgTool.
 
StatusCode sysStart () override
 Start AlgTool.
 
StatusCode sysStop () override
 Stop AlgTool.
 
StatusCode sysFinalize () override
 Finalize AlgTool.
 
StatusCode sysReinitialize () override
 Initialize AlgTool.
 
StatusCode sysRestart () override
 Start AlgTool.
 
 AlgTool (std::string type, std::string name, const IInterface *parent)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator.
 
ISvcLocatorsvcLoc () const
 shortcut for the method service locator
 
IDataProviderSvcevtSvc () const
 accessor to event service service
 
IToolSvctoolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present.
 
SmartIF< IServiceservice (std::string_view name, const bool createIf=true, const bool quiet=false) const
 Return a pointer to the service identified by name (or "type/name")
 
template<typename T>
SmartIF< T > service (std::string_view name, const bool createIf=true, const bool quiet=false) const
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T>
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
void acceptDHVisitor (IDataHandleVisitor *) const override
 
void registerTool (IAlgTool *tool) const
 
void deregisterTool (IAlgTool *tool) const
 
const std::vector< IAlgTool * > & tools () const
 
IAuditorSvcauditorSvc () const
 Access the auditor service.
 
IMonitorSvcmonitorSvc () const
 Access the monitor service.
 
template<class T>
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information.
 
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case)
 
 ~AlgTool () override
 
- Public Member Functions inherited from DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > > > >
std::vector< Gaudi::DataHandle * > inputHandles () const override
 
std::vector< Gaudi::DataHandle * > outputHandles () const override
 
virtual const DataObjIDCollextraInputDeps () const override
 
virtual const DataObjIDCollextraOutputDeps () const override
 
void declare (Gaudi::DataHandle &handle) override
 
void renounce (Gaudi::DataHandle &handle) override
 
bool renounceInput (const DataObjID &id) override
 
const DataObjIDCollinputDataObjs () const override
 
const DataObjIDColloutputDataObjs () const override
 
void addDependency (const DataObjID &id, const Gaudi::DataHandle::Mode &mode) override
 
- Public Member Functions inherited from extends< PropertyHolder< CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > > >, IDataHandleHolder >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation.
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 

Protected Member Functions

StatusCode createSelector (const std::string &, const std::string &, IEvtSelector *&) override
 
StatusCode createStream (const std::string &, const std::string &, EventSelectorDataStream *&) override
 
StatusCode connectStream (EventSelectorDataStream *)
 Connect single stream by reference.
 
StatusCode connectStream (const std::string &)
 Connect single stream by name.
 
Streams::iterator getStreamIterator (const std::string &)
 
- Protected Member Functions inherited from AlgTool
template<typename I>
void declareInterface (I *i)
 
std::vector< IAlgTool * > & tools ()
 
- Protected Member Functions inherited from DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > > > >
void initDataHandleHolder ()
 initializes all handles - called by the sysInitialize method of any descendant of this
 
- Protected Member Functions inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches.
 
MSG::Level resetMessaging ()
 Reinitialize internal states.
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
 

Protected Attributes

size_type m_streamID = 0
 
size_type m_streamCount = 0
 
Streams m_streams
 
StreamSpecs m_streamSpecs
 
SmartIF< IIncidentSvcm_incidentSvc = nullptr
 Reference to the incident service.
 
- Protected Attributes inherited from AlgTool
std::unique_ptr< IDataHandleVisitorm_updateDataHandles
 Hook for for derived classes to provide a custom visitor for data handles.
 
- Protected Attributes inherited from DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > > > >
DataObjIDColl m_inputDataObjs
 
DataObjIDColl m_outputDataObjs
 

Private Member Functions

 DataStreamTool (const DataStreamTool &)=delete
 Fake copy constructor (never implemented).
 
DataStreamTooloperator= (const DataStreamTool &)=delete
 Fake assignment operator (never implemented).
 

Detailed Description

Author
Andres Felipe Osorio Oliveros
Marco Clemencic
Date
2006-09-21

Definition at line 31 of file DataStreamTool.h.

Member Typedef Documentation

◆ Properties

typedef std::vector<Gaudi::Property<std::string> > DataStreamTool::Properties

Definition at line 34 of file DataStreamTool.h.

◆ Streams

Definition at line 33 of file DataStreamTool.h.

Constructor & Destructor Documentation

◆ DataStreamTool()

DataStreamTool::DataStreamTool ( const DataStreamTool & )
privatedelete

Fake copy constructor (never implemented).

Member Function Documentation

◆ addStream()

StatusCode DataStreamTool::addStream ( const std::string & input)
override

Definition at line 39 of file DataStreamTool.cpp.

39 {
40
41 if ( getStream( input ) ) { warning() << "Input stream " << input << "already in use" << endmsg; }
42
43 m_streamSpecs.push_back( input );
44
45 auto strname = name() + '_' + std::to_string( ++m_streamCount );
46 EventSelectorDataStream* s = nullptr;
47
48 StatusCode status = createStream( strname, input, s );
49
50 if ( status.isSuccess() && s ) {
51 s->addRef();
52 m_streams.push_back( s );
53 status = StatusCode::SUCCESS;
54 } else {
55 if ( s ) {
56 s->release();
57 error() << "Error connecting/creating Stream: " << s << endmsg;
58 }
59 error() << "Error connecting/creating Stream: " << input << endmsg;
60 status = StatusCode::FAILURE;
61 }
62 return status;
63}
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition AlgTool.cpp:72
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
StatusCode createStream(const std::string &, const std::string &, EventSelectorDataStream *&) override
EventSelectorDataStream * getStream(const std::string &) override
Retrieve stream by name.
StreamSpecs m_streamSpecs
size_type m_streamCount
bool isSuccess() const
Definition StatusCode.h:314
constexpr static const auto SUCCESS
Definition StatusCode.h:99
constexpr static const auto FAILURE
Definition StatusCode.h:100

◆ addStreams()

StatusCode DataStreamTool::addStreams ( const StreamSpecs & inputs)
override

Definition at line 65 of file DataStreamTool.cpp.

65 {
66
67 StatusCode status = StatusCode::SUCCESS;
68 for ( auto& i : inputs ) {
69 status = addStream( i );
70 if ( !status.isSuccess() ) break;
71 }
72 return status;
73}
StatusCode addStream(const std::string &) override

◆ beginOfStreams()

virtual Streams::iterator DataStreamTool::beginOfStreams ( )
inlinevirtual

Definition at line 71 of file DataStreamTool.h.

71{ return m_streams.begin(); }

◆ clear()

StatusCode DataStreamTool::clear ( )
override

Definition at line 173 of file DataStreamTool.cpp.

173 {
174
175 StatusCode iret, status = StatusCode::SUCCESS;
176 iret.ignore();
177
178 // disconnect the streams
179 for ( auto& il : m_streamSpecs ) {
180 EventSelectorDataStream* s = getStream( il );
181 if ( s ) {
182 if ( s->isInitialized() ) {
183 iret = finalizeStream( s );
184 if ( !iret.isSuccess() ) {
185 error() << "Error finalizing Stream" << il << endmsg;
186 status = iret;
187 }
188 }
189 iret = eraseStream( il );
190 if ( !iret.isSuccess() ) {
191 error() << "Error diconnecting Stream" << il << endmsg;
192 status = iret;
193 }
194 }
195 }
196
197 m_streamSpecs.clear();
198
199 return status;
200}
StatusCode finalizeStream(EventSelectorDataStream *) override
Finalize no longer needed stream.
StatusCode eraseStream(const std::string &) override
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition StatusCode.h:139

◆ connectStream() [1/2]

StatusCode DataStreamTool::connectStream ( const std::string & info)
protected

Connect single stream by name.

Definition at line 210 of file DataStreamTool.cpp.

210 {
211 if ( getStream( info ) ) { warning() << "Input stream " << info << "already in use" << endmsg; }
212 auto nam = name() + '_' + std::to_string( ++m_streamCount );
213 EventSelectorDataStream* s = nullptr;
214 StatusCode status = createStream( nam, info, s );
215 if ( status.isSuccess() ) return connectStream( s );
216 s->release();
217 return status;
218}
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode connectStream(EventSelectorDataStream *)
Connect single stream by reference.

◆ connectStream() [2/2]

StatusCode DataStreamTool::connectStream ( EventSelectorDataStream * s)
protected

Connect single stream by reference.

Definition at line 202 of file DataStreamTool.cpp.

202 {
203
204 if ( !s ) return StatusCode::FAILURE;
205 s->addRef();
206 m_streams.push_back( s );
207 return StatusCode::SUCCESS;
208}

◆ createSelector()

StatusCode DataStreamTool::createSelector ( const std::string & nam,
const std::string & typ,
IEvtSelector *& sel )
overrideprotected

Definition at line 103 of file DataStreamTool.cpp.

103 {
104 auto isvc = make_SmartIF( Service::Factory::create( typ, nam, serviceLocator() ).release() );
105 if ( isvc ) {
106 auto isel = isvc.as<IEvtSelector>();
107 if ( isel ) {
108 sel = isel.get();
109 sel->addRef(); // make sure that sel is not left dangling once isel and isvc go out of scope...
110 return StatusCode::SUCCESS;
111 }
112 }
113 sel = nullptr;
114 error() << "Failed to create IEvtSelector " << typ << "/" << nam << endmsg;
115 return StatusCode::FAILURE;
116}
SmartIF< IFace > make_SmartIF(IFace *iface)
Definition SmartIF.h:143
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition AlgTool.cpp:78
str release
Definition conf.py:27

◆ createStream()

StatusCode DataStreamTool::createStream ( const std::string & nam,
const std::string & info,
EventSelectorDataStream *& stream )
overrideprotected

Definition at line 150 of file DataStreamTool.cpp.

151 {
152 stream = new EventSelectorDataStream( nam, info, serviceLocator() );
153 return StatusCode::SUCCESS;
154}
stream
Definition Write.py:32

◆ endOfStreams()

virtual Streams::iterator DataStreamTool::endOfStreams ( )
inlinevirtual

Definition at line 73 of file DataStreamTool.h.

73{ return m_streams.end(); }

◆ eraseStream()

StatusCode DataStreamTool::eraseStream ( const std::string & info)
override

Definition at line 139 of file DataStreamTool.cpp.

139 {
140
141 auto i = getStreamIterator( info );
142 if ( i != m_streams.end() ) {
143 ( *i )->release();
144 m_streams.erase( i );
145 return StatusCode::SUCCESS;
146 }
147 return StatusCode::FAILURE;
148}
Streams::iterator getStreamIterator(const std::string &)

◆ finalize()

StatusCode DataStreamTool::finalize ( )
override

Definition at line 75 of file DataStreamTool.cpp.

75 {
76 clear().ignore();
77 m_incidentSvc.reset();
78 return AlgTool::finalize();
79}
StatusCode finalize() override
Definition AlgTool.cpp:225
StatusCode clear() override
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.

◆ finalizeStream()

StatusCode DataStreamTool::finalizeStream ( EventSelectorDataStream * s)
override

Finalize no longer needed stream.

Definition at line 118 of file DataStreamTool.cpp.

118 {
119 if ( s ) {
120 IEvtSelector* sel = s->selector();
121 if ( sel ) {
122 SmartIF<IService> isvc( sel );
123 if ( isvc ) {
124 isvc->finalize().ignore();
125 s->finalize().ignore();
126 // Fire EndStream "Incident"
127 m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndStream ) );
128 return StatusCode::SUCCESS;
129 }
130 // Failed to get service interface of sub-event selector
131 return StatusCode::FAILURE;
132 }
133 // No selector (yet) attached - no need to finalize it!
134 return StatusCode::SUCCESS;
135 }
136 return StatusCode::FAILURE;
137}

◆ getNextStream()

StatusCode DataStreamTool::getNextStream ( const EventSelectorDataStream *& esds,
size_type & dsid )
override

Definition at line 226 of file DataStreamTool.cpp.

226 {
227
228 EventSelectorDataStream* nextStream = getStream( dsid );
229 if ( !nextStream ) return StatusCode::FAILURE; //<-end of streams reached
230
231 esds = nextStream;
232 ++m_streamID;
233
234 return StatusCode::SUCCESS;
235}
size_type m_streamID

◆ getPreviousStream()

StatusCode DataStreamTool::getPreviousStream ( const EventSelectorDataStream *& esds,
size_type & dsid )
override

Definition at line 237 of file DataStreamTool.cpp.

237 {
238
239 EventSelectorDataStream* previousStream = getStream( dsid );
240 if ( !previousStream ) return StatusCode::FAILURE; //<-begin of streams reached
241
242 esds = previousStream;
243 --m_streamID;
244
245 return StatusCode::SUCCESS;
246}

◆ getStream() [1/2]

EventSelectorDataStream * DataStreamTool::getStream ( const std::string & info)
override

Retrieve stream by name.

Definition at line 156 of file DataStreamTool.cpp.

156 {
157 auto i = getStreamIterator( info );
158 return i != m_streams.end() ? *i : nullptr;
159}

◆ getStream() [2/2]

EventSelectorDataStream * DataStreamTool::getStream ( size_type pos)
override

Definition at line 166 of file DataStreamTool.cpp.

166 {
167 // pos has to point inside the vector
168 return ( ( pos >= 0 ) && ( (size_t)pos < m_streams.size() ) ) ? m_streams[pos] : nullptr;
169}

◆ getStreamIterator()

DataStreamTool::Streams::iterator DataStreamTool::getStreamIterator ( const std::string & info)
protected

Definition at line 161 of file DataStreamTool.cpp.

161 {
162 return std::find_if( std::begin( m_streams ), std::end( m_streams ),
163 [&]( const EventSelectorDataStream* i ) { return i->definition() == info; } );
164}
const std::string & definition() const
Retrieve definition string.

◆ getStreams()

virtual Streams & DataStreamTool::getStreams ( )
inlinevirtual

Definition at line 69 of file DataStreamTool.h.

69{ return m_streams; }

◆ initialize()

StatusCode DataStreamTool::initialize ( )
override

Definition at line 22 of file DataStreamTool.cpp.

22 {
23 StatusCode status = AlgTool::initialize();
24 if ( !status.isSuccess() ) {
25 fatal() << "Error. Cannot initialize base class." << endmsg;
26 return status;
27 }
28
29 // Get the references to the services that are needed by the ApplicationMgr itself
30 m_incidentSvc = serviceLocator()->service( "IncidentSvc" );
31 if ( !m_incidentSvc ) {
32 fatal() << "Error retrieving IncidentSvc." << endmsg;
34 }
35
37}
StatusCode initialize() override
Definition AlgTool.cpp:173
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.

◆ initializeStream()

StatusCode DataStreamTool::initializeStream ( EventSelectorDataStream * s)
override

Initialize newly opened stream.

Definition at line 81 of file DataStreamTool.cpp.

81 {
82 IEvtSelector* sel = nullptr;
83 StatusCode status = s->initialize();
84 if ( status.isSuccess() ) {
85 status = createSelector( s->name(), s->selectorType(), sel );
86 if ( status.isSuccess() ) {
87 SmartIF<IProperty> prop( sel ); // Att: IProperty, IService used to point to EventSelector
88 SmartIF<IService> isvc( sel );
89 s->setSelector( sel );
90 sel->release(); // No need for this interface anymore, it is passed to the stream
91 if ( prop && isvc ) {
92 for ( const auto& i : s->properties() ) prop->setProperty( i ).ignore();
93 prop->setProperty( Gaudi::Property<int>( "OutputLevel", msgLevel() ) ).ignore();
94 // FIXME: (MCl) Why do we have to initialize the selector here?
95 return isvc->sysInitialize();
96 }
97 }
98 }
100}
StatusCode createSelector(const std::string &, const std::string &, IEvtSelector *&) override

◆ lastStream()

EventSelectorDataStream * DataStreamTool::lastStream ( )
override

Definition at line 171 of file DataStreamTool.cpp.

171{ return m_streams.back(); }

◆ operator=()

DataStreamTool & DataStreamTool::operator= ( const DataStreamTool & )
privatedelete

Fake assignment operator (never implemented).

◆ size()

size_type DataStreamTool::size ( )
inlineoverride

Definition at line 65 of file DataStreamTool.h.

65{ return m_streams.size(); }

Member Data Documentation

◆ m_incidentSvc

SmartIF<IIncidentSvc> DataStreamTool::m_incidentSvc = nullptr
protected

Reference to the incident service.

Definition at line 94 of file DataStreamTool.h.

◆ m_streamCount

size_type DataStreamTool::m_streamCount = 0
protected

Definition at line 87 of file DataStreamTool.h.

◆ m_streamID

size_type DataStreamTool::m_streamID = 0
protected

Definition at line 85 of file DataStreamTool.h.

◆ m_streams

Streams DataStreamTool::m_streams
protected

Definition at line 89 of file DataStreamTool.h.

◆ m_streamSpecs

StreamSpecs DataStreamTool::m_streamSpecs
protected

Definition at line 91 of file DataStreamTool.h.


The documentation for this class was generated from the following files: