Class Reference for E1039 Core & Analysis Software
Fun4AllEventOutStream.h
Go to the documentation of this file.
1 #ifndef __FUN4ALLEVENTOUTSTREAM_H__
2 #define __FUN4ALLEVENTOUTSTREAM_H__
3 
4 // base class for output streams writing Events in
5 // one or the other form
6 
7 #include "Fun4AllBase.h"
8 #include <Event/phenixTypes.h>
9 
10 #ifndef __CINT__
11 #include <boost/version.hpp> // to get BOOST_VERSION
12 #if (__GNUC__ == 4 && __GNUC_MINOR__ == 8 && (BOOST_VERSION == 105700 || BOOST_VERSION == 106000 || BOOST_VERSION == 106300) )
13 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
14 #include <boost/numeric/interval.hpp>
15 #pragma GCC diagnostic warning "-Wunused-local-typedefs"
16 #else
17 #include <boost/numeric/interval.hpp>
18 #endif
19 #endif
20 
21 #include <map>
22 #include <set>
23 #include <string>
24 
25 
26 class Event;
27 class Packet;
29 
31 {
32  public:
33  virtual ~Fun4AllEventOutStream();
34  virtual int StreamStatus() {return 0;}
35  virtual int WriteEvent(Event *evt);
36  virtual int WriteEventOut(Event* /*evt*/) {return 0;}
37  virtual int CloseOutStream() {return 0;}
38 
39  int AddPacket(const int ipkt);
40  int DropPacket(const int ipkt);
41  int AddPacketRange(const int minpacket, const int maxpacket);
42  int DropPacketRange(const int minpacket, const int maxpacket);
44 
45  protected:
46 
47  Fun4AllEventOutStream(const std::string &name= "OUTSTREAM");
48  int resize_evtbuf(const unsigned int newsize);
49  PHDWORD *evtbuf;
50  unsigned int evtbuf_size;
51 // flag to stear behavior, if 1 only add packets (drop all others), if 0 no filtering,
52 // if -1 accept all, drop selected and afterwards add back selected ones
54  Packet **plist;
56  int npackets;
58 #ifndef __CINT__
59  std::map<int,boost::numeric::interval<int> > addpktrange;
60  std::map<int,boost::numeric::interval<int> > droppktrange;
61 #endif
62  Fun4AllEventOutputManager *mymanager; // pointer to my master
63 };
64 
65 #endif /* __FUN4ALLEVENTOUTSTREAM_H__ */
Definition: Event.h:13
std::map< int, boost::numeric::interval< int > > droppktrange
int AddPacketRange(const int minpacket, const int maxpacket)
Fun4AllEventOutputManager * mymanager
Fun4AllEventOutStream(const std::string &name="OUTSTREAM")
int resize_evtbuf(const unsigned int newsize)
int AddPacket(const int ipkt)
int DropPacket(const int ipkt)
int DropPacketRange(const int minpacket, const int maxpacket)
virtual int WriteEventOut(Event *)
std::map< int, boost::numeric::interval< int > > addpktrange
virtual int WriteEvent(Event *evt)
void SetManager(Fun4AllEventOutputManager *myman)