Qore DataProvider Module Reference 3.1
Loading...
Searching...
No Matches
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
31namespace DataProvider {
38const DP_OP_AND = "AND";
39
41const DP_OP_OR = "OR";
43
49
51const DP_SEARCH_OP_REGEX = "regex";
52
54
56const DP_SEARCH_OP_LT = "<";
57
59
61const DP_SEARCH_OP_LE = "<=";
62
64
66const DP_SEARCH_OP_GT = ">";
67
69
71const DP_SEARCH_OP_GE = ">=";
72
74
76const DP_SEARCH_OP_NE = "!=";
77
79
81const DP_SEARCH_OP_EQ = "=";
82
84
86const DP_SEARCH_OP_BETWEEN = "between";
87
89
91const DP_SEARCH_OP_IN = "in";
92
94
96const DP_SEARCH_OP_NOT = "not";
98
100public struct SearchOperatorInfo {
101 string op;
102 auto arg;
103};
104
107
108
125 hash<SearchOperatorInfo> dp_make_op(string op, auto arg);
126
127
129
138 hash<SearchOperatorInfo> dp_op_regex(string str);
139
140
142
151 hash<SearchOperatorInfo> dp_op_like(string str);
152
153
155
164 hash<SearchOperatorInfo> dp_op_lt(auto arg);
165
166
168
177 hash<SearchOperatorInfo> dp_op_le(auto arg);
178
179
181
190 hash<SearchOperatorInfo> dp_op_gt(auto arg);
191
192
194
203 hash<SearchOperatorInfo> dp_op_ge(auto arg);
204
205
207
216 hash<SearchOperatorInfo> dp_op_ne(auto arg);
217
218
220
229 hash<SearchOperatorInfo> dp_op_eq(auto arg);
230
231
233
245 hash<SearchOperatorInfo> dp_op_between(auto l, auto r);
246
247
249
256 hash<SearchOperatorInfo> dp_op_in();
257
258
260
269 hash<SearchOperatorInfo> dp_op_in(list<auto> args);
270
271
273
280 hash<SearchOperatorInfo> dp_op_not(hash<auto> arg);
281
283
285
288class AbstractDataProviderRecordIterator : public AbstractIterator {
289
290public:
292 const DefaultBlockSize = 1000;
293
294protected:
297
298public:
299
302
303
305
310
311
313
318
319
321
323 *hash<string, AbstractDataField> getRecordType();
324
325
327
329 abstract hash<auto> getValue();
330
332
338protected:
339 auto doMemberGate(string key);
340public:
341
342
344
349protected:
350 static bool matchGeneric(hash<auto> record, hash<DataProviderExpression> where_cond);
351public:
352
353
355
360protected:
361 static bool matchGeneric(hash<auto> record, *hash<auto> where_cond);
362public:
363
364
366protected:
367 static bool evalOperator(string field, hash<auto> cmd, hash<auto> op, hash<auto> record);
368public:
369
370
372
375protected:
376 static bool matchGenericValue(auto expects, auto val);
377public:
378
379};
380};
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:288
static bool matchGeneric(hash< auto > record, *hash< auto > where_cond)
Checks if the current record matches the search criteria.
abstract hash< auto > getValue()
returns a single record if the iterator is valid
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.
const DefaultBlockSize
Default block size.
Definition AbstractDataProviderRecordIterator.qc.dox.h:292
bool supportsBulkApi()
Returns True if the iterator supports bulk operation.
static bool matchGeneric(hash< auto > record, hash< DataProviderExpression > where_cond)
Checks if the current record matches the search criteria.
int block_size
Block size for bulk iteration.
Definition AbstractDataProviderRecordIterator.qc.dox.h:296
auto doMemberGate(string key)
Returns the value of the given field in the current record, if the iterator is valid.
constructor(int block_size=DefaultBlockSize)
Creates the object and optionally sets the bulk iteration block size.
*hash< string, AbstractDataField > getRecordType()
Returns the record description, if available.
hash< SearchOperatorInfo > dp_op_ge(auto arg)
returns an SearchOperatorInfo hash for the ">=" 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
hash< SearchOperatorInfo > dp_op_between(auto l, auto r)
returns an SearchOperatorInfo hash for the "between" operator with the given arguments
hash< SearchOperatorInfo > dp_op_lt(auto arg)
returns an SearchOperatorInfo hash for the "<" operator with the given argument
hash< SearchOperatorInfo > dp_op_regex(string str)
returns an SearchOperatorInfo hash for regular expression matches
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_eq(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
hash< SearchOperatorInfo > dp_op_not(hash< auto > arg)
returns an SearchOperatorInfo hash for the "not" operator
hash< SearchOperatorInfo > dp_op_le(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_make_op(string op, auto arg)
const DP_SEARCH_OP_EQ
Identifies the generic data provider equals operator (=) for use in generic search criteria.
Definition AbstractDataProviderRecordIterator.qc.dox.h:81
const DP_SEARCH_OP_REGEX
Definition AbstractDataProviderRecordIterator.qc.dox.h:51
const DP_SEARCH_OP_GT
Identifies the generic data provider greater than operator (>) for use in generic search criteria.
Definition AbstractDataProviderRecordIterator.qc.dox.h:66
const DP_SEARCH_OP_IN
Identifies the generic data provider "in" operator for use in generic search criteria.
Definition AbstractDataProviderRecordIterator.qc.dox.h:91
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:71
const DP_SEARCH_OP_BETWEEN
Identifies the generic data provider "between" operator for use in generic search criteria.
Definition AbstractDataProviderRecordIterator.qc.dox.h:86
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:76
const DP_SEARCH_OP_NOT
Identifies the generic data provider "not" operator for use in generic search criteria.
Definition AbstractDataProviderRecordIterator.qc.dox.h:96
const DP_SEARCH_OP_LT
Identifies the generic data provider less than (<) operator for use in generic search criteria.
Definition AbstractDataProviderRecordIterator.qc.dox.h:56
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:61
const DP_OP_OR
OR logic.
Definition AbstractDataProviderRecordIterator.qc.dox.h:41
const DP_OP_AND
Definition AbstractDataProviderRecordIterator.qc.dox.h:38
Qore AbstractDataField class definition.
Definition AbstractDataField.qc.dox.h:27
const DefaultGenericSearchOpMap
a hash of valid operators for use in generic search criteria
Definition AbstractDataProviderRecordIterator.qc.dox.h:106
Generic operator info hash as returned by all generic search operator functions.
Definition AbstractDataProviderRecordIterator.qc.dox.h:100
string op
the operator string code
Definition AbstractDataProviderRecordIterator.qc.dox.h:101
auto arg
optional argument
Definition AbstractDataProviderRecordIterator.qc.dox.h:102