The Gaudi Framework  master (37c0b60a)
DataStreamTool.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_DATASTREAMTOOL_H
12 #define GAUDIKERNEL_DATASTREAMTOOL_H 1
13 
14 // Include files
15 
16 #include <vector>
17 
18 // from Gaudi
19 #include <GaudiKernel/AlgTool.h>
23 #include <GaudiKernel/Service.h>
24 
25 class IIncidentSvc;
26 
38 class GAUDI_API DataStreamTool : public extends<AlgTool, IDataStreamTool> {
39 public:
42 
44  using extends::extends;
45 
46  StatusCode initialize() override;
47 
48  StatusCode finalize() override;
49 
51  StatusCode initializeStream( EventSelectorDataStream* ) override;
52 
54  StatusCode finalizeStream( EventSelectorDataStream* ) override;
55 
56  StatusCode getNextStream( const EventSelectorDataStream*&, size_type& ) override;
57 
58  StatusCode getPreviousStream( const EventSelectorDataStream*&, size_type& ) override;
59 
60  StatusCode addStream( const std::string& ) override;
61 
62  StatusCode addStreams( const StreamSpecs& ) override;
63 
64  StatusCode eraseStream( const std::string& ) override;
66  EventSelectorDataStream* getStream( const std::string& ) override;
67 
68  EventSelectorDataStream* getStream( size_type ) override;
69 
70  EventSelectorDataStream* lastStream() override;
71 
72  size_type size() override { return m_streams.size(); }
73 
74  StatusCode clear() override;
75 
76  virtual Streams& getStreams() { return m_streams; }
77 
78  virtual Streams::iterator beginOfStreams() { return m_streams.begin(); }
79 
80  virtual Streams::iterator endOfStreams() { return m_streams.end(); }
81 
82 protected:
83  StatusCode createSelector( const std::string&, const std::string&, IEvtSelector*& ) override;
84 
85  StatusCode createStream( const std::string&, const std::string&, EventSelectorDataStream*& ) override;
86 
88  StatusCode connectStream( EventSelectorDataStream* );
90  StatusCode connectStream( const std::string& );
91 
92  size_type m_streamID = 0;
93 
94  size_type m_streamCount = 0;
95 
97 
98  StreamSpecs m_streamSpecs;
99 
101  SmartIF<IIncidentSvc> m_incidentSvc = nullptr;
102 
103  Streams::iterator getStreamIterator( const std::string& );
104 
105 private:
107  DataStreamTool( const DataStreamTool& ) = delete;
110 };
111 #endif // GAUDIKERNEL_DATASTREAMTOOL_H
DataStreamTool::Properties
std::vector< Gaudi::Property< std::string > > Properties
Definition: DataStreamTool.h:41
std::string
STL class.
DataStreamTool::Streams
std::vector< EventSelectorDataStream * > Streams
Definition: DataStreamTool.h:40
std::vector< EventSelectorDataStream * >
DataStreamTool::beginOfStreams
virtual Streams::iterator beginOfStreams()
Definition: DataStreamTool.h:78
IEvtSelector
Definition: IEvtSelector.h:28
IEvtSelector.h
DataStreamTool::endOfStreams
virtual Streams::iterator endOfStreams()
Definition: DataStreamTool.h:80
DataStreamTool::size
size_type size() override
Definition: DataStreamTool.h:72
DataStreamTool
Definition: DataStreamTool.h:38
IIncidentSvc.h
DataStreamTool::operator=
DataStreamTool & operator=(const DataStreamTool &)=delete
Fake assignment operator (never implemented).
StatusCode
Definition: StatusCode.h:65
SmartIF< IIncidentSvc >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
Service.h
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:55
IDataStreamTool.h
AlgTool.h
DataStreamTool::DataStreamTool
DataStreamTool(const DataStreamTool &)=delete
Fake copy constructor (never implemented).
DataStreamTool::m_streamSpecs
StreamSpecs m_streamSpecs
Definition: DataStreamTool.h:98
IIncidentSvc
Definition: IIncidentSvc.h:33
DataStreamTool::getStreams
virtual Streams & getStreams()
Definition: DataStreamTool.h:76
DataStreamTool::m_streams
Streams m_streams
Definition: DataStreamTool.h:96
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:81