CARMA C++
MultiComponentFilter.h
Go to the documentation of this file.
1 #ifndef CARMA_DBMS_MULTICOMPONENTFILTER_H
2 #define CARMA_DBMS_MULTICOMPONENTFILTER_H
3 
16 #include <string>
17 #include <vector>
19 
20 namespace carma {
21 namespace dbms {
22 
26 class MultiComponentFilter : public Filter {
27 
28 public:
29 
37  typedef enum {
38  AND,
39  OR
40  } Conjunction;
41 
50  MultiComponentFilter(const Filter * const child1,
51  const Filter * const child2, const Conjunction &conj);
52 
57 
63  //virtual std::string toString() const;
64 
73  virtual std::string toString(const std::string& tableName = "",
74  const std::string& columnNamePrepender = "")
75  const;
76 
83  std::vector<const carma::dbms::Filter *> getChildren() const;
84 
90  std::vector<const carma::dbms::Filter* > getDescendants() const;
91 
98  void getDescendants(std::vector<const carma::dbms::Filter* > *descendants)
99  const;
100 
109  (std::vector<const carma::dbms::OneComponentFilter* > *descendants)
110  const;
111 
116  virtual std::string name() const;
117 
118 protected:
119 
120  // disallow default constructor
122  // for use only by derived classes
123  MultiComponentFilter(const Conjunction &conj);
124 
125  const Filter *child1_;
126  const Filter *child2_;
127  Conjunction conj_;
128 
129 private:
133  MultiComponentFilter(MultiComponentFilter& rhs);
134 
135 };
136 
137 
138 }}
139 
140 #endif // CARMA_DBMS_MULTICOMPONENTFILTER_H
141 
virtual std::string name() const
get the class name for log messages etc.
virtual std::string toString(const std::string &tableName="", const std::string &columnNamePrepender="") const
string representation of the filter.
std::vector< const carma::dbms::Filter * > getDescendants() const
Return all the descendents of this filter.
abstract base class to represent a simple one component filter
void getOneComponentFilterDescendants(std::vector< const carma::dbms::OneComponentFilter * > *descendants) const
get the OneComponentFilter descendants (leaf nodes) of this filter and put them in the supplied vecto...
abstract base class to represent an SQL query filter (part of a WHERE clause) .
Definition: Filter.h:25
std::vector< const carma::dbms::Filter * > getChildren() const
get the children of this filter.
Conjunction
describes how to combine two filters
represents an SQL query multi-component filter (part of a WHERE clause)