Column Store
ConditionQuery.h
Go to the documentation of this file.
1 #pragma once
2 #include <memory>
3 #include <string>
4 #include <unordered_map>
5 
7 #include "Validators.h"
8 
16 namespace ColumnStore {
26  public:
41  };
42 
47  virtual ~ConditionQuery() {}
48 };
49 
54 typedef std::shared_ptr<ConditionQuery> Query;
55 
60 class AndQuery : public ConditionQuery {
63 
64  public:
80  query1->getValidator(metadata), query2->getValidator(metadata)));
81  }
82 };
83 
88 class OrQuery : public ConditionQuery {
91 
92  public:
108  query1->getValidator(metadata), query2->getValidator(metadata)));
109  }
110 };
111 
116 class NotQuery : public ConditionQuery {
118 
119  public:
133  return RecordValidator(
134  new NotRecordValidator(query1->getValidator(metadata)));
135  }
136 };
137 
142 class EqualQuery : public ConditionQuery {
143  std::string name;
144  std::any value;
145 
146  public:
153  EqualQuery(std::string name, std::any value) : name(name), value(value) {}
161  return RecordValidator(new EqualRecordValidator(name, value, metadata));
162  }
163 };
164 
170  std::string name;
171  std::any value;
172 
173  public:
180  LessThanQuery(std::string name, std::any value)
181  : name(name), value(value) {}
182 
190  return RecordValidator(
191  new LessThanRecordValidator(name, value, metadata));
192  }
193 };
194 }; // namespace ColumnStore
ColumnStore::OrQuery
Logical OR query.
Definition: ConditionQuery.h:88
ColumnStore::RecordValidatorInterface
Base RecordValidator Interface.
Definition: Validators.h:16
ColumnStore::NotRecordValidator
Inverts RecordValidator.
Definition: Validators.h:70
ColumnStore::Query
std::shared_ptr< ConditionQuery > Query
Shared pointer to Query Structure.
Definition: ConditionQuery.h:54
ColumnStore::RecordValidator
std::shared_ptr< RecordValidatorInterface > RecordValidator
Shared Pointer for RecordValidator Interface.
Definition: Validators.h:39
ColumnStore::LessThanQuery::name
std::string name
Definition: ConditionQuery.h:170
ColumnStore
Definition: ColStoreDataGenerator.h:22
ColumnStore::EqualQuery::name
std::string name
Definition: ConditionQuery.h:143
ColumnStore::AndRecordValidator
Logical AND RecordValidator.
Definition: Validators.h:95
ColumnStore::OrQuery::getValidator
RecordValidator getValidator(Metadata metadata)
Get the Validator object.
Definition: ConditionQuery.h:106
ColumnStore::EqualQuery
Equality Query.
Definition: ConditionQuery.h:142
ColumnStore::Metadata
std::shared_ptr< DataRecordMetadata > Metadata
Shared pointer to DataRecordMetadata.
Definition: DataRecord.h:208
ColumnStore::EqualQuery::getValidator
RecordValidator getValidator(Metadata metadata)
Get the Validator object.
Definition: ConditionQuery.h:160
ColumnStore::AndQuery::query1
Query query1
Definition: ConditionQuery.h:61
ColumnStore::EqualRecordValidator
Checks equality of a data field.
Definition: Validators.h:155
ColumnStore::ConditionQuery
Base Condition Query Structure.
Definition: ConditionQuery.h:25
ColumnStore::LessThanQuery
Less Than Query.
Definition: ConditionQuery.h:169
ColumnStore::AndQuery::AndQuery
AndQuery(Query query1, Query query2)
Construct a new And Query object.
Definition: ConditionQuery.h:71
ColumnStore::ConditionQuery::getValidator
virtual RecordValidator getValidator(Metadata metadata)
Get the Valdiator object which complies to ConditionInterface.
Definition: ConditionQuery.h:39
Validators.h
RecordValidator Interfaces and Implementations for Query Processing.
ColumnStore::EqualQuery::value
std::any value
Definition: ConditionQuery.h:144
ColumnStore::NotQuery::NotQuery
NotQuery(Query query1)
Construct a new Not Query object.
Definition: ConditionQuery.h:125
ColumnStore::AndQuery::query2
Query query2
Definition: ConditionQuery.h:62
ColumnStore::AndQuery
Logical AND query.
Definition: ConditionQuery.h:60
ColumnStore::LessThanQuery::getValidator
RecordValidator getValidator(Metadata metadata)
Get the Validator object.
Definition: ConditionQuery.h:189
DataGeneratorInterface.h
Data Generator Interface.
ColumnStore::EqualQuery::EqualQuery
EqualQuery(std::string name, std::any value)
Construct a new Equal Query object.
Definition: ConditionQuery.h:153
ColumnStore::NotQuery
Logical NOT query.
Definition: ConditionQuery.h:116
ColumnStore::OrQuery::OrQuery
OrQuery(Query query1, Query query2)
Construct a new Or Query object.
Definition: ConditionQuery.h:99
ColumnStore::NotQuery::getValidator
RecordValidator getValidator(Metadata metadata)
Get the Validator object.
Definition: ConditionQuery.h:132
ColumnStore::OrRecordValidator
Logical OR RecordValidator.
Definition: Validators.h:125
ColumnStore::AndQuery::getValidator
RecordValidator getValidator(Metadata metadata)
Get the Validator object.
Definition: ConditionQuery.h:78
ColumnStore::ConditionQuery::~ConditionQuery
virtual ~ConditionQuery()
Destroy the Condition Query object.
Definition: ConditionQuery.h:47
ColumnStore::LessThanQuery::value
std::any value
Definition: ConditionQuery.h:171
ColumnStore::LessThanQuery::LessThanQuery
LessThanQuery(std::string name, std::any value)
Construct a new Less Than Query object.
Definition: ConditionQuery.h:180
ColumnStore::NotQuery::query1
Query query1
Definition: ConditionQuery.h:117
ColumnStore::OrQuery::query1
Query query1
Definition: ConditionQuery.h:89
ColumnStore::OrQuery::query2
Query query2
Definition: ConditionQuery.h:90
ColumnStore::LessThanRecordValidator
Checks if value of a field is less than given value.
Definition: Validators.h:204