Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OnlMonComm.h
Go to the documentation of this file.
1 #ifndef _ONL_MON_COMM__H__
2 #define _ONL_MON_COMM__H__
3 #include <vector>
4 class TSocket;
5 
6 class OnlMonComm {
7  public:
8  typedef enum { SP_ALL, SP_LAST, SP_RANGE } SpillMode_t;
9 
10  private:
11  static OnlMonComm* m_inst;
12 
13  SpillMode_t m_sp_mode;
14  int m_sp_num;
15  int m_sp_lo; //< Low of selected range
16  int m_sp_hi; //< High of selected range
17  int m_sp_min; //< Min of full (not selected) range
18  int m_sp_max; //< Max of full scale
19  bool m_sp_sel; //< True if spills are selectable
20  int m_n_sp_sel_max; //< Max number of spills for which spills are kept selectable.
21 
22  typedef std::vector<int> SpillList_t;
23  SpillList_t m_list_sp;
24 
25  public:
26  static OnlMonComm *instance();
27  virtual ~OnlMonComm();
28 
29  void SetSpillMode(const SpillMode_t mode) { m_sp_mode = mode; }
30  SpillMode_t GetSpillMode() { return m_sp_mode; }
31 
32  void SetSpillSelectability(const bool val) { m_sp_sel = val; }
33  bool GetSpillSelectability() { return m_sp_sel; }
34 
35  void SetSpillNum(const int num) { m_sp_num = num; }
36  int GetSpillNum() { return m_sp_num; }
37 
38  void SetSpillRangeLow (const int sp); //< Set the low edge of selected spills
39  void SetSpillRangeHigh(const int sp); //< Set the high edge of selected spills
40  void SetSpillRange(const int sp_lo, const int sp_hi); //< Set the range of selected spills
41  void GetSpillRange(int& sp_lo, int& sp_hi); //< Get the range of selected spills
42 
43  void SetMaxNumSelSpills(const int val) { m_n_sp_sel_max = val; }
44  int GetMaxNumSelSpills() { return m_n_sp_sel_max; }
45 
46  int GetNumSpills() { return (int)m_list_sp.size(); } //< Used in the server process
47  void ClearSpill() { m_list_sp.clear(); } //< Used in the server process
48  void AddSpill(const int id); //< Used in the server process
49  void FindFullSpillRange(int& id_min, int& id_max); //< Used in the server process
50 
51  int ReceiveFullSpillRange(); //< Used in the viewer process
52  void GetFullSpillRange(int& id_min, int& id_max); //< Used in the viewer process
53 
54  TSocket* ConnectServer();
55 
56  protected:
57  OnlMonComm();
58 };
59 
60 #endif // _ONL_MON_COMM__H__
bool GetSpillSelectability()
Definition: OnlMonComm.h:33
int GetNumSpills()
Definition: OnlMonComm.h:46
int GetSpillNum()
Definition: OnlMonComm.h:36
void SetSpillRangeHigh(const int sp)
Definition: OnlMonComm.cc:45
void SetSpillMode(const SpillMode_t mode)
Definition: OnlMonComm.h:29
void AddSpill(const int id)
Definition: OnlMonComm.cc:62
void GetSpillRange(int &sp_lo, int &sp_hi)
Definition: OnlMonComm.cc:56
void SetSpillNum(const int num)
Definition: OnlMonComm.h:35
SpillMode_t GetSpillMode()
Definition: OnlMonComm.h:30
TSocket * ConnectServer()
Definition: OnlMonComm.cc:111
int GetMaxNumSelSpills()
Definition: OnlMonComm.h:44
void SetSpillSelectability(const bool val)
Definition: OnlMonComm.h:32
void SetSpillRange(const int sp_lo, const int sp_hi)
Definition: OnlMonComm.cc:50
void SetSpillRangeLow(const int sp)
Definition: OnlMonComm.cc:40
int ReceiveFullSpillRange()
Definition: OnlMonComm.cc:78
void ClearSpill()
Definition: OnlMonComm.h:47
void FindFullSpillRange(int &id_min, int &id_max)
Definition: OnlMonComm.cc:67
static OnlMonComm * instance()
Definition: OnlMonComm.cc:16
void GetFullSpillRange(int &id_min, int &id_max)
Definition: OnlMonComm.cc:105
virtual ~OnlMonComm()
Definition: OnlMonComm.cc:35
void SetMaxNumSelSpills(const int val)
Definition: OnlMonComm.h:43