OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
QueryFeatures.h
Go to the documentation of this file.
1 #ifndef QUERYFEATURES_H
2 #define QUERYFEATURES_H
3 
4 class GeoExprFeature { /* Implement me */
5  public:
6  bool isPreflightCountRequired() const { return false; }
7 
8  private:
9 };
10 
12  public:
13  bool isArrayExprPresent() const { return array_expr_presence_; }
14  int getArrayExprCount() const { return array_expr_count_; }
16  array_expr_presence_ = true;
17  return array_expr_count_++;
18  };
19 
20  // Note: Not needed if checked_malloc in use
22 
23  private:
24  bool array_expr_presence_ = false;
26 };
27 
29  public:
32 
33  private:
34  bool cpu_only_required_ = false;
35 };
36 
37 template <typename... FEATURE_MARKERS>
38 class QueryFeatureAggregator : public FEATURE_MARKERS... {
39  public:
40  bool isPreflightCountRequired() const {
41  return internalIsPreflightCountRequired<FEATURE_MARKERS...>();
42  }
43 
44  private:
45  template <typename FEATURE_TYPE>
47  return this->FEATURE_TYPE::isPreflightCountRequired()();
48  }
49 
50  template <typename FIRST_FEATURE_TYPE,
51  typename SECOND_FEATURE_TYPE,
52  typename... REMAINING_FEATURES>
54  return this->FIRST_FEATURE_TYPE::isPreflightCountRequired()() ||
55  internalIsPreflightCountRequired<SECOND_FEATURE_TYPE, REMAINING_FEATURES...>();
56  }
57 };
58 
61 
62 #endif
bool isPreflightCountRequired() const
Definition: QueryFeatures.h:21
int getAndBumpArrayExprCount()
Definition: QueryFeatures.h:15
bool isPreflightCountRequired() const
Definition: QueryFeatures.h:40
bool internalIsPreflightCountRequired() const
Definition: QueryFeatures.h:46
int getArrayExprCount() const
Definition: QueryFeatures.h:14
bool isPreflightCountRequired() const
Definition: QueryFeatures.h:6
void setCPUOnlyExecutionRequired()
Definition: QueryFeatures.h:31
bool isArrayExprPresent() const
Definition: QueryFeatures.h:13
bool isCPUOnlyExecutionRequired() const
Definition: QueryFeatures.h:30
bool internalIsPreflightCountRequired() const
Definition: QueryFeatures.h:53