Qore DataProvider Module Reference 2.7.5
|
describes a data type More...
#include <AbstractDataProviderType.qc.dox.h>
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, *hash< auto > tags) | |
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. | |
string | getDesc () |
Returns the description. | |
*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, AbstractDataField > | getFields () |
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< DataTypeInfo > | getInfo () |
Returns a description of the type as a hash. | |
hash< DataTypeInfo > | getInputInfo () |
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. | |
auto | getTag (string tag) |
Returns the value of the given tag. | |
*hash< auto > | getTags () |
Returns tags set on the type. | |
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 (string typename, *hash< auto > options) |
Returns an appropriate object for the given type. More... | |
static AbstractDataProviderType | get (Type type, *hash< auto > options, *hash< auto > tags) |
Returns an appropriate object for the given type. | |
Public Attributes | |
const | DefaultDesc = "no description available" |
Default description. | |
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 | |
*hash< auto > | tags |
type tags | |
describes a data type
|
pure virtual |
Returns the value if the value can be assigned to the type.
value | the value to assign to the type |
Implemented in DataProvider::HashDataType, DataProvider::HashDeclDataType, DataProvider::ListDataType, DataProvider::QoreBinaryDataTypeBase, DataProvider::QoreBoolDataTypeBase, DataProvider::QoreDataType, DataProvider::QoreDateDataTypeBase, DataProvider::QoreFloatDataTypeBase, DataProvider::QoreIntDataTypeBase, DataProvider::QoreNumberDataTypeBase, DataProvider::QoreStringDataTypeBase, and DataProvider::SoftListDataType.
DataProvider::AbstractDataProviderType::constructor | ( | hash< auto > | options, |
*hash< auto > | tags | ||
) |
creates the type and sets options
options | a hash of options, if any options match supported options for this type, they are set |
tags | any user-defined tags to set on the type |
TYPE-OPTION-ERROR | option value has an invalid type |
|
static |
Returns an appropriate object for the given type.
typename | the name of the type; should be a valid Qore type string |
options | type options for the data type object |
hash< DataTypeInfo > DataProvider::AbstractDataProviderType::getInputInfo | ( | ) |
Returns a description of the type as an input type.
name
types_returned
fields
base_type
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
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
DataProvider::AbstractDataProviderType::setOption | ( | string | opt, |
auto | value | ||
) |
sets the given option on the type
opt | the option to set |
value | the value to set |
TYPE-OPTION-ERROR | invalid option or invalid option type |
DataProvider::AbstractDataProviderType::setOptions | ( | hash< auto > | options | ) |
sets options on the type
options | the options to set; unsupported options are ignored |
TYPE-OPTION-ERROR | invalid option type |