Qore DataProvider Module Reference  2.2
AbstractDataProviderRecordIterator.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
25 // assume local scope for variables, do not use "$" signs
26 // require type definitions everywhere
28 // enable all warnings
29 
31 namespace DataProvider {
37 
39 const DP_SEARCH_OP_REGEX = "regex";
40 
42 
44 const DP_SEARCH_OP_LT = "<";
45 
47 
49 const DP_SEARCH_OP_LE = "<=";
50 
52 
54 const DP_SEARCH_OP_GT = ">";
55 
57 
59 const DP_SEARCH_OP_GE = ">=";
60 
62 
64 const DP_SEARCH_OP_NE = "!=";
65 
67 
69 const DP_SEARCH_OP_EQ = "=";
70 
72 
74 const DP_SEARCH_OP_BETWEEN = "between";
75 
77 
79 const DP_SEARCH_OP_IN = "in";
80 
82 
84 const DP_SEARCH_OP_NOT = "not";
86 
88 public struct SearchOperatorInfo {
89  string op;
90  auto arg;
91 };
92 
95 
96 
113  hash<SearchOperatorInfo> dp_make_op(string op, auto arg);
114 
115 
117 
126  hash<SearchOperatorInfo> dp_op_regex(string str);
127 
128 
130 
139  hash<SearchOperatorInfo> dp_op_like(string str);
140 
141 
143 
152  hash<SearchOperatorInfo> dp_op_lt(auto arg);
153 
154 
156 
165  hash<SearchOperatorInfo> dp_op_le(auto arg);
166 
167 
169 
178  hash<SearchOperatorInfo> dp_op_gt(auto arg);
179 
180 
182 
191  hash<SearchOperatorInfo> dp_op_ge(auto arg);
192 
193 
195 
204  hash<SearchOperatorInfo> dp_op_ne(auto arg);
205 
206 
208 
217  hash<SearchOperatorInfo> dp_op_eq(auto arg);
218 
219 
221 
233  hash<SearchOperatorInfo> dp_op_between(auto l, auto r);
234 
235 
237 
244  hash<SearchOperatorInfo> dp_op_in();
245 
246 
248 
257  hash<SearchOperatorInfo> dp_op_in(list<auto> args);
258 
259 
261 
268  hash<SearchOperatorInfo> dp_op_not(hash<auto> arg);
269 
271 
273 
276 class AbstractDataProviderRecordIterator : public AbstractIterator {
277 
278 public:
280 
285 
286 
288 
293 
294 
296 
298  *hash<string, AbstractDataField> getRecordType();
299 
300 
302 
304  abstract hash<auto> getValue();
305 
307 
313 protected:
314  auto doMemberGate(string key);
315 public:
316 
317 
319 
324 protected:
325  static bool matchGeneric(hash<auto> record, *hash<auto> where_cond);
326 public:
327 
328 
330 protected:
331  static bool evalOperator(string field, hash<auto> cmd, hash<auto> op, hash<auto> record);
332 public:
333 
334 
336 
339 protected:
340  static bool matchGenericValue(auto expects, auto val);
341 public:
342 
343 };
344 };
Defines the abstract class for data provider iterators; the destructor releases the iterator.
Definition: AbstractDataProviderBulkRecordInterface.qc.dox.h:33
Defines the abstract class for data provider iterators; the destructor releases the iterator.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:276
static bool matchGeneric(hash< auto > record, *hash< auto > where_cond)
Checks if the current record matches the search criteria.
*hash< string, AbstractDataField > getRecordType()
Returns the record description, if available.
static bool matchGenericValue(auto expects, auto val)
Match a single value.
static bool evalOperator(string field, hash< auto > cmd, hash< auto > op, hash< auto > record)
Evaluates a generic search operator on the field value and record and returns the result.
*AbstractDataProviderBulkRecordInterface getBulkApi()
Returns the bulk data interface if supported.
bool supportsBulkApi()
Returns True if the iterator supports bulk operation.
abstract hash< auto > getValue()
returns a single record if the iterator is valid
auto doMemberGate(string key)
Returns the value of the given field in the current record, if the iterator is valid.
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
const DP_SEARCH_OP_EQ
Identifies the generic data provider equals operator (=) for use in generic search criteria.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:69
hash< SearchOperatorInfo > dp_op_eq(auto arg)
returns an SearchOperatorInfo hash for the "=" operator with the given argument
const DP_SEARCH_OP_REGEX
Identifies the regex operator for use in generic search criteria.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:39
const DP_SEARCH_OP_GT
Identifies the generic data provider greater than operator (>) for use in generic search criteria.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:54
const DP_SEARCH_OP_IN
Identifies the generic data provider "in" operator for use in generic search criteria.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:79
hash< SearchOperatorInfo > dp_op_between(auto l, auto r)
returns an SearchOperatorInfo hash for the "between" operator with the given arguments
const DP_SEARCH_OP_GE
Identifies the generic data provider greater than or equals operator (>=) for use in generic search c...
Definition: AbstractDataProviderRecordIterator.qc.dox.h:59
const DP_SEARCH_OP_BETWEEN
Identifies the generic data provider "between" operator for use in generic search criteria.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:74
const DefaultGenericSearchOpMap
a hash of valid operators for use in generic search criteria
Definition: AbstractDataProviderRecordIterator.qc.dox.h:94
const DP_SEARCH_OP_NE
Identifies the generic data provider not equals operator (!= or <>) for use in generic search criteri...
Definition: AbstractDataProviderRecordIterator.qc.dox.h:64
hash< SearchOperatorInfo > dp_op_regex(string str)
returns an SearchOperatorInfo hash for regular expression matches
hash< SearchOperatorInfo > dp_op_not(hash< auto > arg)
returns an SearchOperatorInfo hash for the "not" operator
const DP_SEARCH_OP_NOT
Identifies the generic data provider "not" operator for use in generic search criteria.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:84
hash< SearchOperatorInfo > dp_op_ge(auto arg)
returns an SearchOperatorInfo hash for the ">=" operator with the given argument
hash< SearchOperatorInfo > dp_op_ne(auto arg)
returns an SearchOperatorInfo hash for the "!=" or "<>" operator with the given argument
hash< SearchOperatorInfo > dp_op_le(auto arg)
returns an SearchOperatorInfo hash for the "<=" operator with the given argument
const DP_SEARCH_OP_LT
Identifies the generic data provider less than (<) operator for use in generic search criteria.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:44
hash< SearchOperatorInfo > dp_op_like(string str)
returns an SearchOperatorInfo hash for the SQL-like "like" operator with the given argument
hash< SearchOperatorInfo > dp_op_in()
returns an SearchOperatorInfo hash for the "in" operator with all arguments passed to the function
const DP_SEARCH_OP_LE
Identifies the generic data provider less than or equals (<=) operator for use in generic search crit...
Definition: AbstractDataProviderRecordIterator.qc.dox.h:49
hash< SearchOperatorInfo > dp_make_op(string op, auto arg)
returns an SearchOperatorInfo hash
hash< SearchOperatorInfo > dp_op_lt(auto arg)
returns an SearchOperatorInfo hash for the "<" operator with the given argument
hash< SearchOperatorInfo > dp_op_gt(auto arg)
returns an SearchOperatorInfo hash for the ">" operator with the given argument
Generic operator info hash as returned by all generic search operator functions.
Definition: AbstractDataProviderRecordIterator.qc.dox.h:88
string op
the operator string code
Definition: AbstractDataProviderRecordIterator.qc.dox.h:89
auto arg
optional argument
Definition: AbstractDataProviderRecordIterator.qc.dox.h:90