Hall-D Software  alpha
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DEPICSstore.h
Go to the documentation of this file.
1 // $Id$
2 //
3 // File: DEPICSStore.h
4 // Created: Tue Nov 18 15:44:17 EST 2014
5 // Creator: sdobbs (on Linux ifarm1102 2.6.32-220.7.1.el6.x86_64 x86_64)
6 //
7 
8 #ifndef _DEPICSSTORE_H_
9 #define _DEPICSSTORE_H_
10 
11 #include <JANA/JObject.h>
12 #include <JANA/JFactory.h>
13 #include <JANA/JEventLoop.h>
14 #include <JANA/JCalibration.h>
15 #include <JANA/JException.h>
16 //using namespace jana;
17 
18 #include <stdint.h>
19 #include <string>
20 #include <vector>
21 #include <map>
22 using namespace std;
23 
24 #include <DAQ/DEPICSvalue.h>
25 
26 
28 DEPICSvalue_data():value(NULL),first_time(0),cumulative_average(0.) {}
29 
31 
32  time_t first_time;
34 };
36 
37 
38 class DEPICSstore : public jana::JObject {
39 public:
40  JOBJECT_PUBLIC(DEPICSstore);
41  //DEPICSstore() {}
42 
43  const DEPICSvalue *GetValue(string key);
44  const double GetAverage(string name);
45  void AddValue(const DEPICSvalue *new_value);
46 
47  vector<string> GetNames();
48  map<string, DEPICSvalue_data_t> &GetStore() { return stored_values; }
49 
50  void ClearAverages();
51  void ResetStartTimes(time_t new_start_time);
52 
53 
54 private:
55  map<string, DEPICSvalue_data_t> stored_values;
56  map<string, string> pretty_names; // name mapping for pretty printing
57 };
58 
59 #endif // _DEPICSSTORE_H_
double cumulative_average
Definition: DEPICSstore.h:33
map< string, DEPICSvalue_data_t > & GetStore()
Definition: DEPICSstore.h:48
map< string, string > pretty_names
Definition: DEPICSstore.h:56
DEPICSvalue * value
Definition: DEPICSstore.h:30
map< string, DEPICSvalue_data_t > stored_values
Definition: DEPICSstore.h:55
A DEPICSvalue object holds information for a single EPICS value read from the data stream...
Definition: DEPICSvalue.h:37