| Qore DataProvider Module Reference 3.2.2

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
DataProvider::AbstractDataProviderRecordIterator Class Reference

Defines the abstract class for data provider iterators; the destructor releases the iterator. More...

`#include <AbstractDataProviderRecordIterator.qc.dox.h>`

Inheritance diagram for DataProvider::AbstractDataProviderRecordIterator:
[legend]

## Public Member Functions
| constructor (int block_size=DefaultBlockSize)
| Creates the object and optionally sets the bulk iteration block size.
*AbstractDataProviderBulkRecordInterface | getBulkApi ()
| Returns the bulk data interface if supported.
*hash< string, AbstractDataField > | getRecordType ()
| Returns the record description, if available.
abstract hash< auto > | getValue ()
| returns a single record if the iterator is valid
bool | supportsBulkApi ()
| Returns True if the iterator supports bulk operation.

## Public Attributes
const | DefaultBlockSize = 1000
| Default block size.

## Protected Member Functions
auto | doMemberGate (string key)
| Returns the value of the given field in the current record, if the iterator is valid.

## Static Protected Member Functions
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.
static bool | matchGeneric (hash< auto > record, *hash< auto > where_cond)
| Checks if the current record matches the search criteria.
static bool | matchGeneric (hash< auto > record, hash< DataProviderExpression > where_cond)
| Checks if the current record matches the search criteria.
static bool | matchGenericValue (auto expects, auto val)
| Match a single value.

## Protected Attributes
int | block_size = DefaultBlockSize
| Block size for bulk iteration.

## Detailed Description

Defines the abstract class for data provider iterators; the destructor releases the iterator.

this class also implements generic search APIs that can be used to filter record sets for data providers that do not support native search / filtering APIs

## Member Function Documentation

## ◆ doMemberGate()

auto DataProvider::AbstractDataProviderRecordIterator::doMemberGate | ( | string | key | ) |
| protected

Returns the value of the given field in the current record, if the iterator is valid.

Parameters

  key | the name of the field

Returns
  the value of the given field in the current record, if the iterator is valid

Exceptions

  FIELD-ERROR | invalid or unknown field name

## ◆ getBulkApi()

*AbstractDataProviderBulkRecordInterface DataProvider::AbstractDataProviderRecordIterator::getBulkApi | ( |  | ) |

Returns the bulk data interface if supported.

Returns
  the bulk data interface if supported

Note
  This base class method returns DefaultBulkRecordIterface by default

## ◆ getRecordType()

*hash< string, AbstractDataField > DataProvider::AbstractDataProviderRecordIterator::getRecordType | ( |  | ) |

Returns the record description, if available.

This base class method returns NOTHING; reimplement in subclasses to provide a record type

## ◆ getValue()

abstract hash< auto > DataProvider::AbstractDataProviderRecordIterator::getValue | ( |  | ) |

returns a single record if the iterator is valid

Exceptions

  INVALID-ITERATOR | the iterator is not pointing at a valid element

## ◆ matchGeneric() [1/2]

static bool DataProvider::AbstractDataProviderRecordIterator::matchGeneric | ( | hash< auto > | record,
|  | *hash< auto > | where_cond )
| static protected

Checks if the current record matches the search criteria.

in case of a hash value, if the hash was created by a search operator function, then that search operation is applied to the input, otherwise a recursive partial match with only the keys given in the value to be checked is performed

## ◆ matchGeneric() [2/2]

static bool DataProvider::AbstractDataProviderRecordIterator::matchGeneric | ( | hash< auto > | record,
|  | hash< DataProviderExpression > | where_cond )
| static protected

Checks if the current record matches the search criteria.

in case of a hash value, if the hash was created by a search operator function, then that search operation is applied to the input, otherwise a recursive partial match with only the keys given in the value to be checked is performed

## ◆ matchGenericValue()

static bool DataProvider::AbstractDataProviderRecordIterator::matchGenericValue | ( | auto | expects,
|  | auto | val )
| static protected

Match a single value.

in case of a hash value, a recursive partial match with only the keys given in the value to be checked is performed

## ◆ supportsBulkApi()

bool DataProvider::AbstractDataProviderRecordIterator::supportsBulkApi | ( |  | ) |

Returns True if the iterator supports bulk operation.

Returns
  True if the iterator supports bulk operation

Note
  This base class method returns True by default and simulates a bulk iterator