otsdaq  v2_05_02_indev
TableViewColumnInfo.h
1 #ifndef _ots_TableTableViewColumnInfo_h_
2 #define _ots_TableTableViewColumnInfo_h_
3 
4 #include <map>
5 #include <memory> /* shared_ptr */
6 #include <string>
7 #include <vector>
8 
9 namespace ots
10 {
12 {
13  public:
14  TableViewColumnInfo(const std::string& type,
15  const std::string& name,
16  const std::string& storageName,
17  const std::string& dataType,
18  const std::string& dataChoicesCSV,
19  std::string* capturedExceptionString);
20  TableViewColumnInfo(const TableViewColumnInfo& c); // copy constructor because of bitmap pointer
21  TableViewColumnInfo& operator=(const TableViewColumnInfo& c); // assignment operator because of bitmap pointer
22 
23  virtual ~TableViewColumnInfo(void);
24 
25  const std::string& getType(void) const;
26  const std::string& getName(void) const;
27  const std::string& getStorageName(void) const;
28  const std::string& getDataType(void) const;
29  const std::string& getDefaultValue(void) const;
30  const std::vector<std::string>& getDataChoices(void) const;
31 
32  struct BitMapInfo // uses dataChoices CSV fields if type is TYPE_BITMAP_DATA
33  {
34  BitMapInfo() : minColor_(""), midColor_(""), maxColor_("") {}
35  unsigned int numOfRows_, numOfColumns_, cellBitSize_;
36  uint64_t minValue_, maxValue_, stepValue_;
37  std::string aspectRatio_;
38  std::string minColor_, midColor_, maxColor_;
39  std::string absMinColor_, absMaxColor_;
40  bool rowsAscending_, colsAscending_, snakeRows_, snakeCols_;
41  };
42  const BitMapInfo& getBitMapInfo(void) const; // uses dataChoices CSV fields if type is TYPE_BITMAP_DATA
43 
44  static std::vector<std::string> getAllTypesForGUI(void);
45  static std::map<std::pair<std::string, std::string>, std::string> getAllDefaultsForGUI(void);
46  static std::vector<std::string> getAllDataTypesForGUI(void);
47 
48  bool isChildLink(void) const;
49  bool isChildLinkUID(void) const;
50  bool isChildLinkGroupID(void) const;
51  bool isGroupID(void) const;
52  bool isUID(void) const;
53  bool isBoolType(void) const;
54  bool isNumberDataType(void) const;
55 
56  std::string getChildLinkIndex(void) const;
57 
58  static const std::string TYPE_UID;
59  static const std::string TYPE_DATA, TYPE_UNIQUE_DATA, TYPE_UNIQUE_GROUP_DATA, TYPE_MULTILINE_DATA, TYPE_FIXED_CHOICE_DATA, TYPE_BITMAP_DATA;
60  static const std::string TYPE_ON_OFF, TYPE_TRUE_FALSE, TYPE_YES_NO;
61  static const std::string TYPE_COMMENT, TYPE_AUTHOR, TYPE_TIMESTAMP;
62  static const std::string TYPE_START_CHILD_LINK, TYPE_START_CHILD_LINK_UID, TYPE_START_CHILD_LINK_GROUP_ID, TYPE_START_GROUP_ID;
63  static const std::string DATATYPE_NUMBER, DATATYPE_STRING, DATATYPE_TIME;
64 
65  static const std::string TYPE_VALUE_YES;
66  static const std::string TYPE_VALUE_NO;
67  static const std::string TYPE_VALUE_TRUE;
68  static const std::string TYPE_VALUE_FALSE;
69  static const std::string TYPE_VALUE_ON;
70  static const std::string TYPE_VALUE_OFF;
71 
72  static const std::string DATATYPE_STRING_DEFAULT;
73  static const std::string DATATYPE_COMMENT_DEFAULT;
74  static const std::string DATATYPE_BOOL_DEFAULT;
75  static const std::string DATATYPE_NUMBER_DEFAULT;
76  static const std::string DATATYPE_TIME_DEFAULT;
77  static const std::string DATATYPE_LINK_DEFAULT;
78 
79  static const std::string COL_NAME_STATUS, COL_NAME_ENABLED, COL_NAME_PRIORITY, COL_NAME_COMMENT, COL_NAME_AUTHOR, COL_NAME_CREATION;
80 
81  private:
82  TableViewColumnInfo(); // private constructor, only used in assignment operator
83  void extractBitMapInfo();
84 
85  protected:
86  std::string type_;
87  std::string name_;
88  std::string storageName_;
89  std::string dataType_;
90  std::vector<std::string> dataChoices_;
91  BitMapInfo* bitMapInfoP_;
92 }; //end TableViewColumnInfo class
93 
94 } // namespace ots
95 
96 #endif