NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
BufdumpMain.h
1 #ifndef __BUFDUMPMAIN_H
2 #define __BUFDUMPMAIN_H
3 
4 /*
5  This software is Copyright by the Board of Trustees of Michigan
6  State University (c) Copyright 2005.
7 
8  You may use this software under the terms of the GNU public license
9  (GPL). The terms of this license are described at:
10 
11  http://www.gnu.org/licenses/gpl.txt
12 
13  Author:
14  Ron Fox
15  NSCL
16  Michigan State University
17  East Lansing, MI 48824-1321
18 */
19 
20 #ifndef __STL_VECTOR
21 #include <vector>
22 #ifndef __STL_VECTOR
23 #define __STL_VECTOR
24 #endif
25 #endif
26 
27 #ifndef __STL_STRING
28 #include <string>
29 #ifndef __STL_STRING
30 #define __STL_STRING
31 #endif
32 #endif
33 
34 #ifndef __CPP_OSTREAM
35 #include <ostream>
36 #ifndef __CPP_STD_OSTREAM
37 #endif
38 #endif
39 
40 #ifndef __CRT_STDINT_H
41 #include <stdint.h>
42 #ifndef __CRT_STDINT_H
43 #define __CRT_STDINT_H
44 #endif
45 #endif
46 
47 
48 // Forward definitiosn:
49 
50 class URL;
51 class CRingItem;
52 class CRingStateChangeItem;
53 class CRingTextItem;
54 class CRingScalerItem;
55 class CRingPhysicsEventCountItem;
56 
57 class CRingBuffer;
58 
59 class Converter;
60 
71 {
72  // private data:
73 
74 private:
75  bool m_ringSource;// True if the data source is a ring buffer.
76  URL* m_pDataSource; // URI that defines the data source.
77  size_t m_skipCount; // Number of items to skip before dumping.
78  size_t m_itemCount; // Number of items to dump before exiting (0 means infinite).
79  Converter *m_prootconverter; // converter to ROOT file
80  std::vector<uint16_t> m_sampleTypes; // Items that should be sampled only (ring buffers).
81  std::vector<uint16_t> m_excludeTypes; // Items that should not be dumped at all.
82 
83  // Canonicals... no need for copy construction etc.
84  //
85 public:
86  BufdumpMain();
87  virtual ~BufdumpMain();
88 protected:
89  BufdumpMain(const BufdumpMain& rhs);
90  BufdumpMain& operator=(const BufdumpMain& rhs);
91  int operator==(const BufdumpMain& rhs) const;
92  int operator!=(const BufdumpMain& rhs) const;
93 public:
94 
95  // Entry point:
96 
97  int operator()(int argc, char** argv);
98 
99  //Utilities:
100 
101 private:
102  CRingItem* getItem(CRingBuffer& ring);
103  void processItem(const CRingItem& item);
104  void dumpStateChangeItem(std::ostream& out, const CRingStateChangeItem& item);
105  void dumpStringListItem(std::ostream& out, const CRingTextItem& item);
106  void dumpScalerItem(std::ostream& out, const CRingScalerItem& item);
107  void dumpPhysicsItem(std::ostream& out, const CRingItem& item);
108  void dumpEventCountItem(std::ostream& out, const CRingPhysicsEventCountItem& item);
109  void dumpUnknownItem(std::ostream& out, const CRingItem& item);
110 
111  std::string defaultSource() const;
112  std::string timeString(time_t theTime) const;
113 
114 };
115 
116 #endif
virtual ~BufdumpMain()
Definition: BufdumpMain.cpp:72
BufdumpMain()
Definition: BufdumpMain.cpp:60
Definition: BufdumpMain.h:70
Base class for all converter objects.
Definition: Converter.h:37
int operator()(int argc, char **argv)
Definition: BufdumpMain.cpp:96