Loading...
Searching...
No Matches
DataProvider::AbstractDataProviderFactory Class Referenceabstract

Data provider factory class. More...

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

Inheritance diagram for DataProvider::AbstractDataProviderFactory:
[legend]

## Public Member Functions

AbstractDataProvider | create (*hash< auto > options)
| Creates an object from the given constructor options.
AbstractDataProvider | createWithTemplate (*hash< auto > template_options, *hash< auto > options)
| Creates an object from the given constructor options.
Class | getClass ()
| Returns the class for the data provider object.
list< hash< auto > > | getExampleProviderRecordOutput (data example, *hash< auto > constructor_options)
| Returns information about a data provider constructor given the example data as an argument.
list< hash< auto > > | getExampleProviderRecordOutput (InputStream example, *hash< auto > constructor_options)
| Returns information about a data provider constructor given the example data as an argument.
hash< DataProviderFactoryInfo > | getInfo ()
| Returns static factory information.
hash< auto > | getInfoAsData (*bool with_type_info)
| Returns static provider information as data; no objects are returned.
string | getName ()
| Returns the name of the data provider factory.
AbstractDataProvider | getProviderFromExample (data example, *hash< auto > constructor_options)
| Returns a data provider given the example data and constructor options as arguments.
AbstractDataProvider | getProviderFromExample (InputStream example, *hash< auto > constructor_options)
| Returns a data provider given the example data and constructor options as arguments.
hash< DataProviderInfo > | getProviderInfo ()
| Returns static provider information.

## Protected Member Functions

| error (string err, string fmt)
| thrown an exception
abstract Class | getClassImpl ()
| Returns the class for the data provider object.
list< hash< auto > > | getExampleProviderRecordOutputImpl (InputStream example, *hash< auto > constructor_options)
| Returns information about a data provider constructor given the example data as an argument.
abstract hash< DataProviderFactoryInfo > | getInfoImpl ()
| Returns static factory information without provider_info.
string | getNameImpl ()
| Returns the name of the data provider factory.
AbstractDataProvider | getProviderFromExampleImpl (InputStream example, *hash< auto > constructor_options)
| Returns a data provider given the example data and constructor options as arguments.
abstract hash< DataProviderInfo > | getProviderInfoImpl ()
| Returns static provider information.

## Detailed Description

Data provider factory class.

## Member Function Documentation

## getExampleProviderRecordOutput() [1/2]

list< hash< auto > > DataProvider::AbstractDataProviderFactory::getExampleProviderRecordOutput | ( | data | example,
|  | *hash< auto > | constructor_options
| ) |  |

Returns information about a data provider constructor given the example data as an argument.

Parameters

  example | example data to process
  constructor_options | constructor options for the data provider

Returns
  example record data parsed from the given options

Exceptions

  DATA-PROVIDER-ERROR | invalid construtor options, API not supported

Since
  DataProvider 2.1

## getExampleProviderRecordOutput() [2/2]

list< hash< auto > > DataProvider::AbstractDataProviderFactory::getExampleProviderRecordOutput | ( | InputStream | example,
|  | *hash< auto > | constructor_options
| ) |  |

Returns information about a data provider constructor given the example data as an argument.

Parameters

  example | example data to process
  constructor_options | constructor options for the data provider

Returns
  example record data parsed from the given options

Exceptions

  DATA-PROVIDER-ERROR | invalid construtor options, API not supported

Since
  DataProvider 2.1

## getExampleProviderRecordOutputImpl()

list< hash< auto > > DataProvider::AbstractDataProviderFactory::getExampleProviderRecordOutputImpl | ( | InputStream | example,
|  | *hash< auto > | constructor_options
| ) |  |

protected

Returns information about a data provider constructor given the example data as an argument.

Parameters

  example | example data to process
  constructor_options | constructor options for the data provider

Returns
  example record data parsed from the given options

Exceptions

  DATA-PROVIDER-ERROR | invalid construtor options, API not supported

Note
  This base class method throws a `DATA-PROVIDER-ERROR` exception by default; override in subclasses to implement this method properly

Since
  DataProvider 2.1

## getInfo()

hash< DataProviderFactoryInfo > DataProvider::AbstractDataProviderFactory::getInfo | ( |  | ) |

Returns static factory information.

Note
  The name and children attributes in provider_info are not returned as they are dynamic attributes

## getInfoAsData()

hash< auto > DataProvider::AbstractDataProviderFactory::getInfoAsData | ( | *bool | with_type_info | ) |

Returns static provider information as data; no objects are returned.

Parameters

  with_type_info | the raw info with objects describing the types

Note
  The name and children attributes in provider_info are not returned as they are dynamic attributes

## getInfoImpl()

abstract hash< DataProviderFactoryInfo > DataProvider::AbstractDataProviderFactory::getInfoImpl | ( |  | ) |

protectedpure virtual

Returns static factory information without provider_info.

Returns
  static factory information without provider_info which is provided by getProviderInfo()

Implemented in DataProvider::NullDataProviderFactory.

## getProviderFromExample() [1/2]

AbstractDataProvider DataProvider::AbstractDataProviderFactory::getProviderFromExample | ( | data | example,
|  | *hash< auto > | constructor_options
| ) |  |

Returns a data provider given the example data and constructor options as arguments.

Parameters

  example | example data to process
  constructor_options | constructor options for the data provider

Returns
  a data provider created from the given options

Exceptions

  DATA-PROVIDER-ERROR | invalid construtor options, API not supported

Note
  if constructor options provide actual input data, then this overrides the example data, in this way this API can be used for the example and also with real data

Since
  DataProvider 2.1

## getProviderFromExample() [2/2]

AbstractDataProvider DataProvider::AbstractDataProviderFactory::getProviderFromExample | ( | InputStream | example,
|  | *hash< auto > | constructor_options
| ) |  |

Returns a data provider given the example data and constructor options as arguments.

Parameters

  example | example data to process
  constructor_options | constructor options for the data provider

Returns
  a data provider created from the given options

Exceptions

  DATA-PROVIDER-ERROR | invalid construtor options, API not supported

Note
  if constructor options provide actual input data, then this overrides the example data, in this way this API can be used for the example and also with real data

Since
  DataProvider 2.1

## getProviderFromExampleImpl()

AbstractDataProvider DataProvider::AbstractDataProviderFactory::getProviderFromExampleImpl | ( | InputStream | example,
|  | *hash< auto > | constructor_options
| ) |  |

protected

Returns a data provider given the example data and constructor options as arguments.

Parameters

  example | example data to process
  constructor_options | constructor options for the data provider

Returns
  a data provider created from the given options

Exceptions

  DATA-PROVIDER-ERROR | invalid construtor options, API not supported

Note
  - If constructor options provide actual input data, then this overrides the example data, in this way this API can be used for the example and also with real data
  - This base class method throws a `DATA-PROVIDER-ERROR` exception by default; override in subclasses to implement this method properly

Since
  DataProvider 2.1

## getProviderInfo()

hash< DataProviderInfo > DataProvider::AbstractDataProviderFactory::getProviderInfo | ( |  | ) |

Returns static provider information.

Note
  The name and children attributes are not returned as they are dynamic attributes

## getProviderInfoImpl()

abstract hash< DataProviderInfo > DataProvider::AbstractDataProviderFactory::getProviderInfoImpl | ( |  | ) |

protectedpure virtual

Returns static provider information.

Note
  The name and children attributes are not returned as they are dynamic attributes

Implemented in DataProvider::NullDataProviderFactory.