All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OutputStream.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H
2 #define GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H
3 
4 // Required for inheritance
5 #include "GaudiKernel/IDataSelector.h"
6 #include "GaudiKernel/Algorithm.h"
7 #include "GaudiKernel/Property.h"
8 
9 // STL include files
10 #include <memory>
11 #include <vector>
12 #include <string>
13 
14 // forward declarations
15 class IIncidentSvc;
16 class IRegistry;
17 class IConversionSvc;
18 class IDataManagerSvc;
19 class OutputStreamAgent;
20 class DataStoreItem;
21 
27 class OutputStream : public Algorithm {
28 public:
29  typedef std::vector<DataStoreItem*> Items;
30  typedef std::vector<std::string> ItemNames;
31  typedef std::map< Algorithm*, Items > AlgDependentItems;
32  typedef std::map< std::string, ItemNames > AlgDependentItemNames;
33 protected:
43  std::string m_storeName;
45  std::string m_persName;
47  std::string m_output;
49  std::string m_outputName;
51  std::string m_outputType;
78  int m_events;
86  std::vector<Algorithm*>* m_acceptAlgs;
88  std::vector<Algorithm*>* m_requireAlgs;
90  std::vector<Algorithm*>* m_vetoAlgs;
91 
92 public:
94  OutputStream(const std::string& name, ISvcLocator* pSvcLocator);
96  virtual ~OutputStream();
97 protected:
101  void acceptAlgsHandler( Property& theProp );
105  void requireAlgsHandler( Property& theProp );
109  void vetoAlgsHandler( Property& theProp );
111  Algorithm* decodeAlgorithm( const std::string& theName );
114  std::vector<Algorithm*>* theAlgs );
116  bool isEventAccepted() const;
118  DataStoreItem* findItem(const std::string& path);
120  virtual StatusCode writeObjects();
121 
124 
126  virtual bool hasInput() const;
127 
128 public:
130  virtual StatusCode initialize();
132  virtual StatusCode finalize();
134  virtual StatusCode execute();
135  // Connect to proper conversion service
138  virtual bool collect(IRegistry* dir, int level);
140  virtual StatusCode collectObjects();
142  void clearItems(Items& itms);
144  void addItem(Items& itms, const std::string& descriptor);
146  void clearSelection();
149 };
150 
151 #endif // GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H