CARMA C++
LogRecordSelector.h
Go to the documentation of this file.
1 #ifndef CARMA_DBMS_LOGRECORDSELECTOR_H
2 #define CARMA_DBMS_LOGRECORDSELECTOR_H
3 
13 #include <string>
14 #include <vector>
15 #include "carma/dbms/ColumnNames.h"
16 #include "carma/dbms/Selector.h"
17 
18 namespace carma {
19 namespace dbms {
20 
25 class LogRecordSelector : public Selector {
26 
27 public:
28 
36  typedef struct {
42  bool frameCount;
48  bool caller;
54  bool priorityID;
64  bool priority;
70  bool logname;
76  bool ndc;
82  bool message;
83  } SelectionMask;
84 
91 
95  virtual ~LogRecordSelector();
96 
101  void setSelectionMask(const SelectionMask& mask);
102 
107 
112  void setCallerMask(bool value)
113  {
114  mask_.caller = value;
115  }
116 
121  void setFrameCountMask(bool value)
122  {
123  mask_.frameCount = value;
124  }
125 
130  void setLognameMask(bool value)
131  {
132  mask_.logname = value;
133  }
134 
139  void setMessageMask(bool value)
140  {
141  mask_.message = value;
142  }
143 
148  void setPriorityMask(bool value)
149  {
150  mask_.priority = value;
151  }
152 
157  void setPriorityIdMask(bool value)
158  {
159  mask_.priority = value;
160  }
161 
162 
167  void setNdcMask(bool value)
168  {
169  mask_.ndc = value;
170  }
171 
175  std::string toString() const;
176 
185  unsigned getSupplementalTableJoinCount() const;
186 
192  unsigned selectedColumnCount() const;
193 
198  SelectionMask nullSelectionMask() const;
199 
200 protected:
201 
202  SelectionMask mask_;
203 
207  void setDefaultSelection_();
208 
209 
210  std::vector<std::string> selectedColumns_() const;
211 
212 };
213 }}
214 
215 #endif // CARMA_DBMS_LOGRECORDSELECTOR_H
216 
LogRecordSelector()
constructor the object is intialized with all the members of its selection mask set to true...
void setFrameCountMask(bool value)
Set the mask value for the Framecount column of the selection.
Holds info on which log record fields should be selected (ie returned) by a query), if a value is set to true, the corresponding field is included in the selection (in cases where if false it is not.
Selector class.
void setPriorityIdMask(bool value)
Set the mask value for the PriorityID column of the selection.
bool ndc
If true, the ndc column is selected.
bool message
If true, the message column is selected.
unsigned selectedColumnCount() const
get the number of columns which will be selected based on the selection mask, monitor point data type...
std::string toString() const
string representation of this selection
bool logname
If true, the logname column is selected.
void setSelectionMask(const SelectionMask &mask)
set the selection mask
SelectionMask getSelectionMask() const
get the selection mask
void setDefaultSelection_()
set the default selection
SelectionMask nullSelectionMask() const
get a selection mask with all fields set to false
void setPriorityMask(bool value)
Set the mask value for the Priority column of the selection.
void setLognameMask(bool value)
Set the mask value for the Logname column of the selection.
access of column names in the database
void setCallerMask(bool value)
Set the mask value for the Caller column of the selection.
bool priority
If true, the priority column from the LogPriorities table is selected.
virtual ~LogRecordSelector()
destructor
unsigned getSupplementalTableJoinCount() const
returns the number of supplemental tables which will need to be joined to the main monitor table(s) t...
Abstract base class to represent an SQL selection (portion of SELECT clause)
Definition: Selector.h:24
void setMessageMask(bool value)
Set the mask value for the Message column of the selection.
void setNdcMask(bool value)
Set the mask value for the ndc column of the selection.
bool priorityID
If true, the priorityID column is selected.
bool frameCount
If true, the frameCount field is selected Default setting is true.
Class to represent an SQL selection (portion of SELECT clause) for a log message. ...