Qore DataProvider Module Reference  1.0.2
DataProvider::AbstractDataProviderType Class Referenceabstract

describes a data type More...

Inheritance diagram for DataProvider::AbstractDataProviderType:

Public Member Methods

abstract auto acceptsValue (auto value)
 returns the value if the value can be assigned to the type More...
 
 constructor ()
 creates the type
 
 constructor (hash< auto > options)
 creates the type and sets options More...
 
abstract hash< string, bool > getAcceptTypeHash ()
 returns a hash of types accepted by this type; keys are type names
 
int getBaseTypeCode ()
 returns the base type code for the type
 
string getBaseTypeName ()
 returns the base type name for the type; must be a standard Qore base type name
 
*hash< string, bool > getDirectTypeHash ()
 returns a hash of native base type code keys where no translations are performed; keys are type codes, not names
 
abstract *AbstractDataProviderType getElementType ()
 returns the subtype (for lists or hashes) if there is only one
 
*AbstractDataField getField (string field_name)
 returns the given field, if present, or NOTHING if not
 
*hash< string, hash< DataFieldInfo > > getFieldInfo ()
 Returns information on fields supported.
 
abstract *hash< string, AbstractDataFieldgetFields ()
 returns the fields of the data structure; if any
 
*AbstractDataProviderType getFieldType (string field_name)
 get the given field type if it exists, otherwise return NOTHING
 
hash< DataTypeInfogetInfo ()
 returns a description of the type as a hash
 
hash< DataTypeInfogetInputInfo ()
 returns a description of the type as an input type More...
 
abstract string getName ()
 returns the type name
 
*hash< auto > getOptions ()
 returns options set on the type
 
auto getOptionValue (string opt)
 returns the value of the given option
 
AbstractDataProviderType getOrNothingType ()
 returns an "or nothing" type equivalent to the current type More...
 
abstract hash< string, bool > getReturnTypeHash ()
 returns a hash of types returned by this type; keys are type names
 
AbstractDataProviderType getSoftType ()
 returns a "soft" type equivalent to the current type More...
 
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions ()
 returns supported options
 
abstract *Type getValueType ()
 returns the base type for the type, if any
 
bool hasType ()
 returns True if the type is not a wildcard type
 
bool isAssignableFrom (AbstractDataProviderType t)
 returns True if this type can be assigned from values of the argument type
 
bool isAssignableFrom (Type t)
 returns True if this type can be assigned from values of the argument type
 
bool isList ()
 returns True if this type is a list
 
bool isMandatory ()
 returns True if the type must have a value
 
bool isOrNothingType ()
 returns True if the type also accepts NOTHING
 
 setOption (string opt, auto value)
 sets the given option on the type More...
 
 setOptions (hash< auto > options)
 sets options on the type More...
 

Static Public Member Methods

static AbstractDataProviderType get (Type type, *hash< auto > options)
 returns an appropriate object for the given type
 
static AbstractDataProviderType get (string typename, *hash< auto > options)
 returns an appropriate object for the given type More...
 

Private Member Methods

 setOptionIntern (string opt, auto value)
 sets the given option without any validation of the option
 

Private Attributes

hash< auto > options
 type options
 

Detailed Description

describes a data type

Member Function Documentation

◆ acceptsValue()

abstract auto DataProvider::AbstractDataProviderType::acceptsValue ( auto  value)
pure virtual

returns the value if the value can be assigned to the type

Parameters
valuethe value to assign to the type
Returns
the value to be assigned; can be converted by the type

Implemented in DataProvider::QoreDataType, DataProvider::ListDataType, DataProvider::QoreDateDataTypeBase, DataProvider::QoreStringDataTypeBase, DataProvider::HashDataType, DataProvider::QoreFloatDataTypeBase, DataProvider::QoreIntDataTypeBase, DataProvider::QoreNumberDataTypeBase, and DataProvider::QoreBoolDataTypeBase.

◆ constructor()

DataProvider::AbstractDataProviderType::constructor ( hash< auto >  options)

creates the type and sets options

Parameters
optionsa hash of options, if any options match supported options for this type, they are set
Exceptions
TYPE-OPTION-ERRORoption value has an invalid type

◆ get()

static AbstractDataProviderType DataProvider::AbstractDataProviderType::get ( string  typename,
*hash< auto >  options 
)
static

returns an appropriate object for the given type

Parameters
typenamethe name of the type; should be a valid Qore type string
optionstype options for the data type object

◆ getInputInfo()

hash<DataTypeInfo> DataProvider::AbstractDataProviderType::getInputInfo ( )

returns a description of the type as an input type

Returns
a description of the type as an input type; only the following keys are returned
  • name
  • types_returned

◆ getOrNothingType()

AbstractDataProviderType DataProvider::AbstractDataProviderType::getOrNothingType ( )

returns an "or nothing" type equivalent to the current type

The base class method returns the same type; this method must be overridden in child classes to return a usable "or nothing" type

Returns
an "or nothing" type equivalent to the current type
Note
recursively updates fields to "or nothing" types as well

◆ getSoftType()

AbstractDataProviderType DataProvider::AbstractDataProviderType::getSoftType ( )

returns a "soft" type equivalent to the current type

The base class method returns the same type; this method must be overridden in child classes to return a usable "soft" type

Returns
a "soft" type equivalent to the current type

◆ setOption()

DataProvider::AbstractDataProviderType::setOption ( string  opt,
auto  value 
)

sets the given option on the type

Parameters
optthe option to set
valuethe value to set
Exceptions
TYPE-OPTION-ERRORinvalid option or invalid option type

◆ setOptions()

DataProvider::AbstractDataProviderType::setOptions ( hash< auto >  options)

sets options on the type

Parameters
optionsthe options to set; unsupported options are ignored
Exceptions
TYPE-OPTION-ERRORinvalid option type