Qore DataProvider Module Reference 2.7.5
Loading...
Searching...
No Matches
DataProvider::DefaultRecordIterator Class Reference

Default record iterator class for data providers that do not support custom read / search APIs. More...

#include <DefaultRecordIterator.qc.dox.h>

Inheritance diagram for DataProvider::DefaultRecordIterator:
[legend]

Public Member Methods

 constructor (AbstractIterator i, *hash< auto > where_cond, *hash< auto > search_options, *hash< string, AbstractDataField > record_type, *string subrecord)
 Returns an iterator for zero or more records matching the search options. More...
 
*hash< string, AbstractDataFieldgetRecordType ()
 Returns the record description, if available. More...
 
hash< auto > getValue ()
 returns a single record if the iterator is valid More...
 
auto memberGate (string key)
 Returns the value of the given field in the current record, if the iterator is valid. More...
 
bool next ()
 Moves the current position to the next element; returns False if there are no more elements. More...
 
bool valid ()
 returns True if the iterator is currently pointing at a valid element, False if not More...
 
- Public Member Methods inherited from DataProvider::AbstractDataProviderRecordIterator
*AbstractDataProviderBulkRecordInterface getBulkApi ()
 Returns the bulk data interface if supported. More...
 
*hash< string, AbstractDataFieldgetRecordType ()
 Returns the record description, if available. More...
 
abstract hash< auto > getValue ()
 returns a single record if the iterator is valid More...
 
bool supportsBulkApi ()
 Returns True if the iterator supports bulk operation. More...
 

Additional Inherited Members

- Private Member Methods inherited from DataProvider::AbstractDataProviderRecordIterator
auto doMemberGate (string key)
 Returns the value of the given field in the current record, if the iterator is valid. More...
 
- Static Private Member Methods inherited from DataProvider::AbstractDataProviderRecordIterator
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. More...
 
static bool matchGeneric (hash< auto > record, hash< DataProviderExpression > where_cond)
 Checks if the current record matches the search criteria. More...
 
static bool matchGenericValue (auto expects, auto val)
 Match a single value. More...
 

Detailed Description

Default record iterator class for data providers that do not support custom read / search APIs.

Note
This class supports the columns, limit, and offset search options

Member Function Documentation

◆ constructor()

DataProvider::DefaultRecordIterator::constructor ( AbstractIterator  i,
*hash< auto >  where_cond,
*hash< auto >  search_options,
*hash< string, AbstractDataField record_type,
*string  subrecord 
)

Returns an iterator for zero or more records matching the search options.

Parameters
ithe iterator; must return a record hash in the getValue() method
where_condthe search criteria
search_optionsthe search options after processing by validateSearchOptions()
record_typethe record type
subrecordthe optional name of a key of the record hash storing record data

◆ getRecordType()

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

Returns the record description, if available.

Returns
the record type of the iterator

◆ getValue()

hash< auto > DataProvider::DefaultRecordIterator::getValue ( )
virtual

returns a single record if the iterator is valid

Exceptions
INVALID-ITERATORthe iterator is not pointing at a valid element

Implements DataProvider::AbstractDataProviderRecordIterator.

◆ memberGate()

auto DataProvider::DefaultRecordIterator::memberGate ( string  key)

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

Parameters
keythe name of the field
Returns
the value of the given field in the current record, if the iterator is valid
Exceptions
FIELD-ERRORinvalid or unknown field name

◆ next()

bool DataProvider::DefaultRecordIterator::next ( )

Moves the current position to the next element; returns False if there are no more elements.

This method will return True again after it returns False once if the object being iterated is not empty, otherwise it will always return False. The iterator object should not be used after this method returns False

Returns
False if there are no more elements (in which case the iterator object is invalid and should not be used); True if successful (meaning that the iterator object is valid)

◆ valid()

bool DataProvider::DefaultRecordIterator::valid ( )

returns True if the iterator is currently pointing at a valid element, False if not

Returns
True if the iterator is currently pointing at a valid element, False if not