| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
DataStreamTool Class Reference

`#include <GaudiKernel/DataStreamTool.h>`

Inheritance diagram for DataStreamTool:
[legend]
Collaboration diagram for DataStreamTool:
[legend]

## Public Types
typedef std::vector< EventSelectorDataStream * > | Streams
typedef std::vector< StringProperty > | Properties
Public Types inherited from extends< AlgTool, IDataStreamTool >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces...>
| Typedef to the base of this class. More...
Public Types inherited from AlgTool
typedef Gaudi::PluginService::Factory< IAlgTool *, const std::string &, const std::string &, const IInterface * > | Factory
Public Types inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces...>
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
| DataStreamTool (const std::string &type, const std::string &name, const IInterface *parent)
| Standard constructor. More...
| ~DataStreamTool () override=default
| Destructor. More...
StatusCode | initialize () override
StatusCode | finalize () override
StatusCode | initializeStream (EventSelectorDataStream *) override
| Initialize newly opened stream. More...
StatusCode | finalizeStream (EventSelectorDataStream *) override
| Finalize no longer needed stream. More...
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
EventSelectorDataStream * | getStream (const std::string &) override
| Retrieve stream by name. More...
EventSelectorDataStream * | getStream (size_type) override
EventSelectorDataStream * | lastStream () override
size_type | size () override
StatusCode | clear () override
virtual Streams & | getStreams ()
virtual Streams::iterator | beginOfStreams ()
virtual Streams::iterator | endOfStreams ()
Public Member Functions inherited from extends< AlgTool, IDataStreamTool >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from AlgTool
StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) override
| Query for a given interface. More...
const std::string & | name () const override
| Retrieve full identifying name of the concrete tool object. More...
const std::string & | type () const override
| Retrieve type (concrete class) of the sub-algtool. More...
const IInterface * | parent () const override
| Retrieve parent of the sub-algtool. More...
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. More...
StatusCode | sysStart () override
| Start AlgTool. More...
StatusCode | sysStop () override
| Stop AlgTool. More...
StatusCode | sysFinalize () override
| Finalize AlgTool. More...
StatusCode | sysReinitialize () override
| Initialize AlgTool. More...
StatusCode | sysRestart () override
| Start AlgTool. More...
StatusCode | setProperty (const Property &p) override
| Default implementations for IProperty interface. More...
StatusCode | setProperty (const std::string &s) override
StatusCode | setProperty (const std::string &n, const std::string &v) override
StatusCode | getProperty (Property *p) const override
const Property & | getProperty (const std::string &name) const override
StatusCode | getProperty (const std::string &n, std::string &v) const override
const std::vector< Property * > & | getProperties () const override
bool | hasProperty (const std::string &name) const override
PropertyMgr * | getPropertyMgr () const
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
| AlgTool (const std::string &type, const std::string &name, const IInterface *parent)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
ISvcLocator * | svcLoc () const
| shortcut for the method service locator More...
IDataProviderSvc * | evtSvc () const
| accessor to event service service More...
IToolSvc * | toolSvc () const
| The standard ToolSvc service, Return a pointer to the service if present. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified in the jobOptions via the job option service. More...
template<class T >
StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &type, const std::string &name, T *&svc) const
| Access a service by name, type creating it if it doesn't already exist. More...
SmartIF< IService > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
| Return a pointer to the service identified by name (or "type/name") More...
template<typename T >
SmartIF< T > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
template<class T >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. More...
template<class T >
Property * | declareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none") const
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
template<class T >
Property * | declareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none") const
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override
virtual const DataObjIDColl & | extraInputDeps () const override
virtual const DataObjIDColl & | extraOutputDeps () const override
virtual void | acceptDHVisitor (IDataHandleVisitor *) const override
DataObjIDColl | inputDataObjs () const
DataObjIDColl | outputDataObjs () const
void | commitHandles () override
void | registerTool (IAlgTool *tool) const
void | deregisterTool (IAlgTool *tool) const
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used public tool. More...
template<class T >
StatusCode | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used private tool. More...
const std::vector< IAlgTool * > & | tools () const
IAuditorSvc * | auditorSvc () const
| Access the auditor service. More...
IMonitorSvc * | monitorSvc () const
| Access the monitor service. More...
template<class T >
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const
| Declare monitoring information. More...
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) More...
| ~AlgTool () override
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces...>
| ~extend_interfaces () override=default
| Virtual destructor. More...

## 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. More...
StatusCode | connectStream (const std::string &)
| Connect single stream by name. More...
Streams::iterator | getStreamIterator (const std::string &)
Protected Member Functions inherited from AlgTool
template<typename I >
void | declareInterface (I *i)
virtual void | declareInput (Gaudi::DataHandle *im) override
virtual void | declareOutput (Gaudi::DataHandle *im) override
std::vector< IAlgTool * > & | tools ()
Protected Member Functions inherited from CommonMessaging< implements< IAlgTool, IDataHandleHolder, IProperty, IStateful > >
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
size_type | m_streamID = 0
size_type | m_streamCount = 0
Streams | m_streams
StreamSpecs | m_streamSpecs
SmartIF< IIncidentSvc > | m_incidentSvc = nullptr
| Reference to the incident service. More...
Protected Attributes inherited from AlgTool
std::unique_ptr< IDataHandleVisitor > | m_updateDataHandles
| Hook for for derived classes to provide a custom visitor for data handles. More...
SmartIF< PropertyMgr > | m_propertyMgr
| Property Manager. More...

## Private Member Functions
| DataStreamTool (const DataStreamTool &)=delete
| Fake copy constructor (never implemented). More...
DataStreamTool & | operator= (const DataStreamTool &)=delete
| Fake assignment operator (never implemented). More...

## Detailed Description

Author
  Andres Felipe Osorio Oliveros
  Marco Clemencic

Date
  2006-09-21

Definition at line 29 of file DataStreamTool.h.

## Member Typedef Documentation

typedef std::vector<StringProperty> DataStreamTool::Properties

Definition at line 34 of file DataStreamTool.h.

typedef std::vector<EventSelectorDataStream*> DataStreamTool::Streams

Definition at line 33 of file DataStreamTool.h.

## Constructor & Destructor Documentation

DataStreamTool::DataStreamTool | ( | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent
| ) |  |

Standard constructor.

Definition at line 25 of file DataStreamTool.cpp.

28 : base_class ( type, name , parent )
29 {
30 //declareInterface<IDataStreamTool>(this);
31 }
extends< AlgTool, IDataStreamTool >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14

DataStreamTool::~DataStreamTool | ( |  | ) |
| override default

Destructor.

DataStreamTool::DataStreamTool | ( | const DataStreamTool & |  | ) |
| private delete

Fake copy constructor (never implemented).

## Member Function Documentation

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

Definition at line 53 of file DataStreamTool.cpp.

53 {
54
55 if ( getStream(input) ) {
56 warning() << "Input stream " << input << "already in use" << endmsg;
57 }
58
59 m_streamSpecs.push_back(input);
60
61 auto strname = name() + '_' + std::to_string( ++m_streamCount );
62 EventSelectorDataStream* s = nullptr;
63
64 StatusCode status = createStream(strname, input , s );
65
66 if( status.isSuccess() && s ) {
67 s->addRef();
68 m_streams.push_back(s);
69 status = StatusCode::SUCCESS;
70 } else {
71 if (s) {
72 s->release();
73 error() << "Error connecting/creating Stream: " << s << endmsg;
74 }
75 error() << "Error connecting/creating Stream: " << input << endmsg;
76 status = StatusCode::FAILURE;
77 }
78 return status;
79 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::to_string
T to_string(T...args)
DataStreamTool::createStream
StatusCode createStream(const std::string &, const std::string &, EventSelectorDataStream *&) override
Definition: DataStreamTool.cpp:169
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
implements::addRef
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataStreamTool::getStream
EventSelectorDataStream * getStream(const std::string &) override
Retrieve stream by name.
Definition: DataStreamTool.cpp:176
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45
DataStreamTool::m_streamCount
size_type m_streamCount
Definition: DataStreamTool.h:94
gaudirun.s
string s
Definition: gaudirun.py:245
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
DataStreamTool::m_streamSpecs
StreamSpecs m_streamSpecs
Definition: DataStreamTool.h:98
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
implements::release
unsigned long release() override
Release Interface instance.
Definition: implements.h:46

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

Definition at line 81 of file DataStreamTool.cpp.

81 {
82
83 StatusCode status = StatusCode::SUCCESS;
84 for ( auto& i : inputs ) {
85 status = addStream(i);
86 if (!status.isSuccess()) break;
87 }
88 return status;
89
90 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataStreamTool::addStream
StatusCode addStream(const std::string &) override
Definition: DataStreamTool.cpp:53
ana.i
list i
Definition: ana.py:128

virtual Streams::iterator DataStreamTool::beginOfStreams | ( |  | ) |
| inline virtual

Definition at line 75 of file DataStreamTool.h.

75 {return m_streams.begin(); };
std::vector::begin
T begin(T...args)
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96

StatusCode DataStreamTool::clear | ( |  | ) |
| override

Definition at line 201 of file DataStreamTool.cpp.

202 {
203
204 StatusCode iret, status = StatusCode::SUCCESS;
205 iret.ignore();
206
207 // disconnect the streams
208 for ( auto& il : m_streamSpecs ) {
209 EventSelectorDataStream* s = getStream(il);
210 if ( s ) {
211 if ( s->isInitialized() ) {
212 iret = finalizeStream(s);
213 if ( !iret.isSuccess() ) {
214 error() << "Error finalizing Stream" << il << endmsg;
215 status = iret;
216 }
217 }
218 iret = eraseStream( il );
219 if ( !iret.isSuccess() ) {
220 error() << "Error diconnecting Stream" << il << endmsg;
221 status = iret;
222 }
223 }
224 }
225
226 m_streamSpecs.clear();
227
228 return status;
229 }
EventSelectorDataStream::isInitialized
bool isInitialized() const
Check initialization status.
Definition: EventSelectorDataStream.h:115
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataStreamTool::finalizeStream
StatusCode finalizeStream(EventSelectorDataStream *) override
Finalize no longer needed stream.
Definition: DataStreamTool.cpp:136
DataStreamTool::getStream
EventSelectorDataStream * getStream(const std::string &) override
Retrieve stream by name.
Definition: DataStreamTool.cpp:176
DataStreamTool::eraseStream
StatusCode eraseStream(const std::string &) override
Definition: DataStreamTool.cpp:158
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45
gaudirun.s
string s
Definition: gaudirun.py:245
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
DataStreamTool::m_streamSpecs
StreamSpecs m_streamSpecs
Definition: DataStreamTool.h:98
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode DataStreamTool::connectStream | ( | EventSelectorDataStream * | s | ) |
| protected

Connect single stream by reference.

Definition at line 232 of file DataStreamTool.cpp.

233 {
234
235 if ( !s ) return StatusCode::FAILURE;
236 s->addRef();
237 m_streams.push_back(s);
238 return StatusCode::SUCCESS;
239
240 }
std::vector::push_back
T push_back(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:29
implements::addRef
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:44
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96

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

Connect single stream by name.

Definition at line 242 of file DataStreamTool.cpp.

243 {
244 if ( getStream(info) ) {
245 warning() << "Input stream " << info << "already in use" << endmsg;
246 }
247 auto nam = name() + '_' + std::to_string( ++m_streamCount);
248 EventSelectorDataStream* s = nullptr;
249 StatusCode status = createStream(nam, info, s);
250 if ( status.isSuccess() ) return connectStream(s);
251 s->release();
252 return status;
253 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::to_string
T to_string(T...args)
DataStreamTool::createStream
StatusCode createStream(const std::string &, const std::string &, EventSelectorDataStream *&) override
Definition: DataStreamTool.cpp:169
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataStreamTool::connectStream
StatusCode connectStream(EventSelectorDataStream *)
Connect single stream by reference.
Definition: DataStreamTool.cpp:232
DataStreamTool::getStream
EventSelectorDataStream * getStream(const std::string &) override
Retrieve stream by name.
Definition: DataStreamTool.cpp:176
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45
DataStreamTool::m_streamCount
size_type m_streamCount
Definition: DataStreamTool.h:94
gaudirun.s
string s
Definition: gaudirun.py:245
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
implements::release
unsigned long release() override
Release Interface instance.
Definition: implements.h:46

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

Definition at line 120 of file DataStreamTool.cpp.

120 {
121 auto isvc = make_SmartIF( Service::Factory::create(typ, nam, serviceLocator()) );
122 if ( isvc ) {
123 auto isel = isvc.as<IEvtSelector>();
124 if ( isel ) {
125 sel = isel.get();
126 sel->addRef(); // make sure that sel is not left dangling once isel and isvc go out of scope...
127 return StatusCode::SUCCESS;
128 }
129 }
130 sel = nullptr;
131 error() << "Failed to create IEvtSelector " << typ << "/" << nam << endmsg;
132 return StatusCode::FAILURE;
133 }
IEvtSelector
The Event Selector Interface.
Definition: IEvtSelector.h:18
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
IInterface::addRef
virtual unsigned long addRef()=0
Increment the reference count of Interface instance.
make_SmartIF
SmartIF< IFace > make_SmartIF(IFace *iface)
Definition: SmartIF.h:143
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Definition at line 169 of file DataStreamTool.cpp.

170 {
171 stream = new EventSelectorDataStream(nam, info, serviceLocator());
172 return StatusCode::SUCCESS;
173 }
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86
StatusCode::SUCCESS
Definition: StatusCode.h:30
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45

virtual Streams::iterator DataStreamTool::endOfStreams | ( |  | ) |
| inline virtual

Definition at line 77 of file DataStreamTool.h.

77 {return m_streams.end(); };
std::vector::end
T end(T...args)
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96

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

Definition at line 158 of file DataStreamTool.cpp.

158 {
159
160 auto i = getStreamIterator(info);
161 if ( i != m_streams.end() ) {
162 (*i)->release();
163 m_streams.erase(i);
164 return StatusCode::SUCCESS;
165 }
166 return StatusCode::FAILURE;
167 }
DataStreamTool::getStreamIterator
Streams::iterator getStreamIterator(const std::string &)
Definition: DataStreamTool.cpp:181
std::vector::end
T end(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
std::vector::erase
T erase(T...args)
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96
ana.i
list i
Definition: ana.py:128

StatusCode DataStreamTool::finalize | ( |  | ) |
| override

Definition at line 92 of file DataStreamTool.cpp.

92 {
93 clear().ignore();
94 m_incidentSvc.reset();
95 return AlgTool::finalize();
96 }
DataStreamTool::clear
StatusCode clear() override
Definition: DataStreamTool.cpp:201
AlgTool::finalize
StatusCode finalize() override
Definition: AlgTool.cpp:360
DataStreamTool::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: DataStreamTool.h:101
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108

StatusCode DataStreamTool::finalizeStream | ( | EventSelectorDataStream * | s | ) |
| override

Finalize no longer needed stream.

Definition at line 136 of file DataStreamTool.cpp.

136 {
137 if ( s ) {
138 IEvtSelector* sel = s->selector();
139 if ( sel ) {
140 SmartIF<IService> isvc(sel);
141 if ( isvc ) {
142 isvc->finalize().ignore();
143 s->finalize().ignore();
144 // Fire EndStream "Incident"
145 m_incidentSvc->fireIncident(Incident(name(),IncidentType::EndStream));
146 return StatusCode::SUCCESS;
147 }
148 // Failed to get service interface of sub-event selector
149 return StatusCode::FAILURE;
150 }
151 // No selector (yet) attached - no need to finalize it!
152 return StatusCode::SUCCESS;
153 }
154 return StatusCode::FAILURE;
155 }
SmartIF< IService >
IEvtSelector
The Event Selector Interface.
Definition: IEvtSelector.h:18
EventSelectorDataStream::selector
IEvtSelector * selector() const
Retrieve event selector object.
Definition: EventSelectorDataStream.h:111
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
read_lhcb_event_file.sel
tuple sel
Definition: read_lhcb_event_file.py:10
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
EventSelectorDataStream::finalize
virtual StatusCode finalize()
Finalize stream and release resources.
Definition: EventSelectorDataStream.cpp:193
DataStreamTool::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: DataStreamTool.h:101
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65

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

Definition at line 262 of file DataStreamTool.cpp.

263 {
264
265 EventSelectorDataStream * nextStream = getStream(dsid);
266 if ( !nextStream ) return StatusCode::FAILURE; //<-end of streams reached
267
268 esds = nextStream;
269 ++m_streamID;
270
271 return StatusCode::SUCCESS;
272
273 }
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataStreamTool::getStream
EventSelectorDataStream * getStream(const std::string &) override
Retrieve stream by name.
Definition: DataStreamTool.cpp:176
DataStreamTool::m_streamID
size_type m_streamID
Definition: DataStreamTool.h:92
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45

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

Definition at line 275 of file DataStreamTool.cpp.

276 {
277
278 EventSelectorDataStream * previousStream = getStream(dsid);
279 if ( !previousStream ) return StatusCode::FAILURE; //<-begin of streams reached
280
281 esds = previousStream;
282 --m_streamID;
283
284 return StatusCode::SUCCESS;
285
286 }
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
DataStreamTool::getStream
EventSelectorDataStream * getStream(const std::string &) override
Retrieve stream by name.
Definition: DataStreamTool.cpp:176
DataStreamTool::m_streamID
size_type m_streamID
Definition: DataStreamTool.h:92
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45

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

Retrieve stream by name.

Definition at line 176 of file DataStreamTool.cpp.

176 {
177 auto i = getStreamIterator(info);
178 return i != m_streams.end() ? *i : nullptr;
179 }
DataStreamTool::getStreamIterator
Streams::iterator getStreamIterator(const std::string &)
Definition: DataStreamTool.cpp:181
std::vector::end
T end(T...args)
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96
ana.i
list i
Definition: ana.py:128

EventSelectorDataStream * DataStreamTool::getStream | ( | size_type | pos | ) |
| override

Definition at line 188 of file DataStreamTool.cpp.

188 {
189 // pos has to point inside the vector
190 return ( (pos >= 0) && ((size_t)pos < m_streams.size()) ) ? m_streams[pos]
191 : nullptr;
192 }
std::vector::size
T size(T...args)
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96

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

Definition at line 181 of file DataStreamTool.cpp.

181 {
182 return std::find_if( std::begin(m_streams), std::end(m_streams),
183 [&](const EventSelectorDataStream* i) {
184 return i->definition()==info;
185 });
186 }
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
std::end
T end(T...args)
EventSelectorDataStream::definition
const std::string & definition() const
Retrieve definition string.
Definition: EventSelectorDataStream.h:107
std::find_if
T find_if(T...args)
std::begin
T begin(T...args)
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96
ana.i
list i
Definition: ana.py:128

virtual Streams& DataStreamTool::getStreams | ( |  | ) |
| inline virtual

Definition at line 73 of file DataStreamTool.h.

73 { return m_streams; };
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96

StatusCode DataStreamTool::initialize | ( |  | ) |
| override

Definition at line 33 of file DataStreamTool.cpp.

33 {
34
35
36 StatusCode status = AlgTool::initialize();
37 if( !status.isSuccess() ) {
38 fatal() << "Error. Cannot initialize base class." << endmsg;
39 return status;
40 }
41
42 // Get the references to the services that are needed by the ApplicationMgr itself
43 m_incidentSvc = serviceLocator()->service("IncidentSvc");
44 if( !m_incidentSvc ) {
45 fatal() << "Error retrieving IncidentSvc." << endmsg;
46 return StatusCode::FAILURE;
47 }
48
49 return StatusCode::SUCCESS;
50
51 }
AlgTool::initialize
StatusCode initialize() override
Definition: AlgTool.cpp:290
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
AlgTool::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: AlgTool.cpp:86
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataStreamTool::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: DataStreamTool.h:101
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode DataStreamTool::initializeStream | ( | EventSelectorDataStream * | s | ) |
| override

Initialize newly opened stream.

Definition at line 98 of file DataStreamTool.cpp.

98 {
99 IEvtSelector* sel = nullptr;
100 StatusCode status = s->initialize();
101 if ( status.isSuccess() ) {
102 status = createSelector(s->name(), s->selectorType(), sel);
103 if ( status.isSuccess() ) {
104 SmartIF<IProperty> prop(sel); //Att: IProperty, IService used to point to EventSelector
105 SmartIF<IService> isvc(sel);
106 s->setSelector(sel);
107 sel->release(); // No need for this interface anymore, it is passed to the stream
108 if ( prop && isvc ) {
109 for( const auto& i : s->properties() ) prop->setProperty(i).ignore();
110 prop->setProperty(IntegerProperty("OutputLevel",msgLevel())).ignore();
111 // FIXME: (MCl) Why do we have to initialize the selector here?
112 return isvc->sysInitialize();
113 }
114 }
115 }
116 return StatusCode::FAILURE;
117 }
SmartIF< IProperty >
EventSelectorDataStream::name
const std::string & name() const
Retrieve stream name.
Definition: EventSelectorDataStream.h:91
IEvtSelector
The Event Selector Interface.
Definition: IEvtSelector.h:18
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
EventSelectorDataStream::initialize
virtual StatusCode initialize()
Parse input criteria.
Definition: EventSelectorDataStream.cpp:62
read_lhcb_event_file.sel
tuple sel
Definition: read_lhcb_event_file.py:10
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
DataStreamTool::createSelector
StatusCode createSelector(const std::string &, const std::string &, IEvtSelector *&) override
Definition: DataStreamTool.cpp:120
IntegerProperty
SimpleProperty< int > IntegerProperty
Definition: Property.h:708
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
EventSelectorDataStream::selectorType
const std::string & selectorType() const
Retrieve event selector type.
Definition: EventSelectorDataStream.h:103
EventSelectorDataStream::properties
const Properties & properties()
Access properties.
Definition: EventSelectorDataStream.h:87
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
Definition: CommonMessaging.h:136
ana.i
list i
Definition: ana.py:128
EventSelectorDataStream::setSelector
virtual void setSelector(IEvtSelector *pSelector)
Attach event selector object.
Definition: EventSelectorDataStream.cpp:43

EventSelectorDataStream * DataStreamTool::lastStream | ( |  | ) |
| override

Definition at line 194 of file DataStreamTool.cpp.

195 {
196 return m_streams.back();
197 }
std::vector::back
T back(T...args)
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96

DataStreamTool& DataStreamTool::operator= | ( | const DataStreamTool & |  | ) |
| private delete

Fake assignment operator (never implemented).

size_type DataStreamTool::size | ( |  | ) |
| inline override

Definition at line 69 of file DataStreamTool.h.

69 { return m_streams.size(); };
std::vector::size
T size(T...args)
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96

## Member Data Documentation

SmartIF<IIncidentSvc> DataStreamTool::m_incidentSvc = nullptr
| protected

Reference to the incident service.

Definition at line 101 of file DataStreamTool.h.

size_type DataStreamTool::m_streamCount = 0
| protected

Definition at line 94 of file DataStreamTool.h.

size_type DataStreamTool::m_streamID = 0
| protected

Definition at line 92 of file DataStreamTool.h.

Streams DataStreamTool::m_streams
| protected

Definition at line 96 of file DataStreamTool.h.

StreamSpecs DataStreamTool::m_streamSpecs
| protected

Definition at line 98 of file DataStreamTool.h.

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

- GaudiKernel/GaudiKernel/DataStreamTool.h
- GaudiKernel/src/Lib/DataStreamTool.cpp