forked from Uradouby/cs660-pa
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIndexPredicate.h
More file actions
45 lines (38 loc) · 1.23 KB
/
Copy pathIndexPredicate.h
File metadata and controls
45 lines (38 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef DB_INDEX_PREDICATE_H
#define DB_INDEX_PREDICATE_H
#include <db/Predicate.h>
#include <db/Field.h>
namespace db {
/**
* IndexPredicate compares a field which has index on it against a given value
* @see simpledb.IndexDbIterator
*/
class IndexPredicate {
Op op;
const Field *fvalue;
/**
* Constructor.
*
* @param fvalue The value that the predicate compares against.
* @param op The operation to apply (as defined in Predicate.Op); either
* Predicate.Op.GREATER_THAN, Predicate.Op.LESS_THAN, Predicate.Op.EQUAL,
* Predicate.Op.GREATER_THAN_OR_EQ, or Predicate.Op.LESS_THAN_OR_EQ
* @see Predicate
*/
public:
IndexPredicate(Op op, const Field *fvalue);
const Field *getField() const;
Op getOp() const;
/** Return true if the fieldvalue in the supplied predicate
is satisfied by this predicate's fieldvalue and
operator.
@param ipd The field to compare against.
*/
bool operator==(const IndexPredicate &other) const;
};
}
template<>
struct std::hash<db::IndexPredicate> {
std::size_t operator()(const db::IndexPredicate &ipd) const;
};
#endif