Qore DataProvider Module Reference  1.0.3
DataProvider::AbstractDataProcessor Class Referenceabstract

Defines an abstract class for accepting data and outputting optionally transformed or filtered data. More...

Public Member Functions

AbstractDataProviderType getExpectedType ()
 Returns the expected type of data to be submitted, if available. More...
 
AbstractDataProviderType getReturnType ()
 Returns the type of data that will be returned, if available. More...
 
 setThreadLocalData (*hash< auto > thread_local_data)
 Sets thread-local data to set before running the processor.
 
auto submit (code enqueue, auto _data)
 Submits the data for processing. More...
 
bool supportsBulkApi ()
 Returns True if the data processor supports bulk operation. More...
 

Protected Member Functions

*AbstractDataProviderType getExpectedTypeImpl ()
 Returns the expected type of data to be submitted, if available. More...
 
*AbstractDataProviderType getReturnTypeImpl ()
 Returns the type of data that will be returned, if available. More...
 
abstract submitImpl (code enqueue, auto _data)
 Submits the data for processing. More...
 
abstract bool supportsBulkApiImpl ()
 Returns True if the data processor supports bulk operation. More...
 

Protected Attributes

*hash< auto > thread_local_data
 Thread-local data to set before running the processor.
 
*list< stringthread_local_data_keys
 Thread-local data keys from thread_local_data.
 

Detailed Description

Defines an abstract class for accepting data and outputting optionally transformed or filtered data.

Member Function Documentation

◆ getExpectedType()

AbstractDataProviderType DataProvider::AbstractDataProcessor::getExpectedType ( )

Returns the expected type of data to be submitted, if available.

Returns
the expected type of data to be submitted, if available
Note
Calls getExpectedTypeImpl() to provide the return value

◆ getExpectedTypeImpl()

*AbstractDataProviderType DataProvider::AbstractDataProcessor::getExpectedTypeImpl ( )
protected

Returns the expected type of data to be submitted, if available.

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

◆ getReturnType()

AbstractDataProviderType DataProvider::AbstractDataProcessor::getReturnType ( )

Returns the type of data that will be returned, if available.

Returns
the type of data that will be returned, if available
Note
Calls getReturnTypeImpl() to provide the return value

◆ getReturnTypeImpl()

*AbstractDataProviderType DataProvider::AbstractDataProcessor::getReturnTypeImpl ( )
protected

Returns the type of data that will be returned, if available.

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

◆ submit()

auto DataProvider::AbstractDataProcessor::submit ( code  enqueue,
auto  _data 
)

Submits the data for processing.

Parameters
enqueues closure taking a single arugment that enqueues the processed data for the next step in the pipeline; if no data should be processed onwards, do not call enqueue; if only one record should be processed onwards, then enqueue should be called only once; if multiple records are generated from the input data, then call it once for each generated record; prototype:
code enqueue = sub (auto qdata) {}
_datathe data to process

Sets thread-local data before running and clears on exit if any is set

Note
  • Calls submitImpl() on the data to do the actual processing
  • Accept and return type information is not enforced in this method; it must be enforced in submitImpl()

◆ submitImpl()

abstract DataProvider::AbstractDataProcessor::submitImpl ( code  enqueue,
auto  _data 
)
protectedpure virtual

Submits the data for processing.

Parameters
enqueues closure taking a single arugment that enqueues the processed data for the next step in the pipeline; if no data should be processed onwards, do not call enqueue; if only one record should be processed onwards, then enqueue should be called only once; if multiple records are generated from the input data, then call it once for each generated record; prototype:
code enqueue = sub (auto qdata) {}
_datathe data to process

◆ supportsBulkApi()

bool DataProvider::AbstractDataProcessor::supportsBulkApi ( )

Returns True if the data processor supports bulk operation.

Returns
True if the data processor supports bulk operation
Note
Calls supportsBulkApiImpl() to return the answer

◆ supportsBulkApiImpl()

abstract bool DataProvider::AbstractDataProcessor::supportsBulkApiImpl ( )
protectedpure virtual

Returns True if the data processor supports bulk operation.

Returns
True if the data processor supports bulk operation
See also
dataprovider_pipeline_bulk_processing