Qore CdsRestDataProvider Module Reference  1.0.0
CdsRestDataProvider::CdsRestRecordIterator Class Reference

Defines the record iterator class for Table-based iterators. More...

Inherits AbstractDataProviderRecordIterator.

Public Member Methods

 constructor (CdsRestClient::CdsRestClient rest, string name, hash< CdsRestRecordInfo > record_info, *hash< auto > where_cond, *hash< auto > search_options)
 creates the iterator More...
 
string getOrClause (list< auto > arglist)
 Returns "or" clauses.
 
*hash< string, DataProvider::AbstractDataFieldgetRecordType ()
 Returns the record description, if available. More...
 
hash< auto > getValue ()
 Returns a single record if the iterator is valid. More...
 
*string makeQuery (*hash< auto > where_cond, *hash< auto > search_options)
 Returns the filter for a request.
 
auto memberGate (string key)
 Returns the value of the given field in the current row, if the iterator is valid. More...
 
bool next ()
 Increments the row pointer when retrieving rows from a select statement; returns True if there is a row to retrieve, False if not. More...
 
bool valid ()
 Returns True if the iterator is valid. More...
 

Private:Internal Attributes

Qore::ListHashIterator i
 record iterator
 
string name
 current object name
 
hash< CdsRestRecordInforecord_info
 Record info for the entity.
 
CdsRestClient::CdsRestClient rest
 The REST client object for API calls.
 

Detailed Description

Defines the record iterator class for Table-based iterators.

Member Function Documentation

◆ constructor()

CdsRestDataProvider::CdsRestRecordIterator::constructor ( CdsRestClient::CdsRestClient  rest,
string  name,
hash< CdsRestRecordInfo record_info,
*hash< auto >  where_cond,
*hash< auto >  search_options 
)

creates the iterator

Parameters
restthe REST client connection
namethe name of the entity
record_inforecord information describing the entity
where_condthe where clause for the query, if any
search_optionssearch options; assumed to have already been processed for validity before this call

◆ getRecordType()

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

Returns the record description, if available.

Returns
the record type of the iterator

◆ getValue()

hash<auto> CdsRestDataProvider::CdsRestRecordIterator::getValue ( )

Returns a single record if the iterator is valid.

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

◆ memberGate()

auto CdsRestDataProvider::CdsRestRecordIterator::memberGate ( string  key)

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

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

◆ next()

bool CdsRestDataProvider::CdsRestRecordIterator::next ( )

Increments the row pointer when retrieving rows from a select statement; returns True if there is a row to retrieve, False if not.

Returns
True if there is a row to retrieve, False if not (no more rows to be retrieved)
Note
Exceptions could be thrown by the DBI driver when the statement is executed; see the relevant DBI driver docs for more information

◆ valid()

bool CdsRestDataProvider::CdsRestRecordIterator::valid ( )

Returns True if the iterator is valid.

Returns
True if the iterator is valid