AbstractDataProviderType.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace DataProvider {
const TypeCodeMap = ...;
const OptimalQoreDataTypeMap = ...;
const OptimalQoreSoftDataTypeMap = ...;
const DataTypeMap = ...;
public struct DataProviderTypeOptionInfo {
string type;
string desc;
};
public struct DataTypeInfo {
string name;
*hash<string, hash<DataProviderTypeOptionInfo>> supported_options;
*hash<auto> options;
string base_type;
bool mandatory;
list<string> types_accepted;
list<string> types_returned;
hash<string, hash<DataFieldInfo>> fields;
bool can_manage_fields = False;
*hash<DataTypeInfo> default_field_type_info;
};
class AbstractDataProviderType : public Serializable {
public:
static Type nothingType = Reflection::NothingType;
static Type anyType = Reflection::AutoType;
// not initialized here to workaround issue #4048 (circular initializtion error)
static AbstractDataProviderType anyDataType;
protected:
hash<auto> options;
public:
constructor();
constructor(hash<auto> options);
*hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
hash<DataTypeInfo> getInputInfo();
hash<DataTypeInfo> getInfo();
*hash<string, hash<DataFieldInfo>> getFieldInfo();
bool isAssignableFrom(AbstractDataProviderType t);
bool isAssignableFrom(Type t);
bool isList();
bool isMandatory();
*AbstractDataField getField(string field_name);
bool hasType();
string getBaseTypeName();
int getBaseTypeCode();
*hash<string, bool> getDirectTypeHash();
bool isOrNothingType();
*AbstractDataProviderType getFieldType(string field_name);
auto getOptionValue(string opt);
*hash<auto> getOptions();
setOption(string opt, auto value);
setOptions(hash<auto> options);
AbstractDataProviderType getSoftType();
AbstractDataProviderType getOrNothingType();
abstract string getName();
abstract *Type getValueType();
abstract *AbstractDataProviderType getElementType();
abstract *hash<string, AbstractDataField> getFields();
abstract hash<string, bool> getAcceptTypeHash();
abstract hash<string, bool> getReturnTypeHash();
abstract auto acceptsValue(auto value);
static AbstractDataProviderType get(Type type, *hash<auto> options);
static AbstractDataProviderType get(string typename, *hash<auto> options);
protected:
setOptionIntern(string opt, auto value);
public:
};
};
DataProvider::AbstractDataField
describes a data type based on a hashdecl
Definition: AbstractDataField.qc.dox.h:44
DataProvider::AbstractDataProviderType
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:91
DataProvider::AbstractDataProviderType::hasType
bool hasType()
Returns True if the type is not a wildcard type.
DataProvider::AbstractDataProviderType::getFieldInfo
*hash< string, hash< DataFieldInfo > > getFieldInfo()
Returns information on fields supported.
DataProvider::AbstractDataProviderType::getBaseTypeCode
int getBaseTypeCode()
Returns the base type code for the type.
DataProvider::AbstractDataProviderType::isAssignableFrom
bool isAssignableFrom(AbstractDataProviderType t)
Returns True if this type can be assigned from values of the argument type.
DataProvider::AbstractDataProviderType::getFieldType
*AbstractDataProviderType getFieldType(string field_name)
get the given field type if it exists, otherwise return NOTHING
DataProvider::AbstractDataProviderType::options
hash< auto > options
type options
Definition: AbstractDataProviderType.qc.dox.h:101
DataProvider::AbstractDataProviderType::get
static AbstractDataProviderType get(Type type, *hash< auto > options)
Returns an appropriate object for the given type.
DataProvider::AbstractDataProviderType::getInfo
hash< DataTypeInfo > getInfo()
Returns a description of the type as a hash.
DataProvider::AbstractDataProviderType::isAssignableFrom
bool isAssignableFrom(Type t)
Returns True if this type can be assigned from values of the argument type.
DataProvider::AbstractDataProviderType::getElementType
abstract *AbstractDataProviderType getElementType()
Returns the subtype (for lists or hashes) if there is only one.
DataProvider::AbstractDataProviderType::getDirectTypeHash
*hash< string, bool > getDirectTypeHash()
Returns a hash of native base type code keys where no translations are performed; keys are type codes...
DataProvider::AbstractDataProviderType::getInputInfo
hash< DataTypeInfo > getInputInfo()
Returns a description of the type as an input type.
DataProvider::AbstractDataProviderType::isMandatory
bool isMandatory()
Returns True if the type must have a value.
DataProvider::AbstractDataProviderType::isList
bool isList()
Returns True if this type is a list.
DataProvider::AbstractDataProviderType::getBaseTypeName
string getBaseTypeName()
Returns the base type name for the type; must be a standard Qore base type name.
DataProvider::AbstractDataProviderType::isOrNothingType
bool isOrNothingType()
Returns True if the type also accepts NOTHING.
DataProvider::AbstractDataProviderType::acceptsValue
abstract auto acceptsValue(auto value)
Returns the value if the value can be assigned to the type.
DataProvider::AbstractDataProviderType::get
static AbstractDataProviderType get(string typename, *hash< auto > options)
Returns an appropriate object for the given type.
DataProvider::AbstractDataProviderType::getSupportedOptions
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
Returns supported options.
DataProvider::AbstractDataProviderType::getOrNothingType
AbstractDataProviderType getOrNothingType()
Returns an "or nothing" type equivalent to the current type.
DataProvider::AbstractDataProviderType::getName
abstract string getName()
Returns the type name.
DataProvider::AbstractDataProviderType::getFields
abstract *hash< string, AbstractDataField > getFields()
Returns the fields of the data structure; if any.
DataProvider::AbstractDataProviderType::setOptionIntern
setOptionIntern(string opt, auto value)
sets the given option without any validation of the option
DataProvider::AbstractDataProviderType::setOptions
setOptions(hash< auto > options)
sets options on the type
DataProvider::AbstractDataProviderType::getValueType
abstract *Type getValueType()
Returns the base type for the type, if any.
DataProvider::AbstractDataProviderType::getField
*AbstractDataField getField(string field_name)
Returns the given field, if present, or NOTHING if not.
DataProvider::AbstractDataProviderType::getOptions
*hash< auto > getOptions()
Returns options set on the type.
DataProvider::AbstractDataProviderType::constructor
constructor()
creates the type
DataProvider::AbstractDataProviderType::getSoftType
AbstractDataProviderType getSoftType()
Returns a "soft" type equivalent to the current type.
DataProvider::AbstractDataProviderType::constructor
constructor(hash< auto > options)
creates the type and sets options
DataProvider::AbstractDataProviderType::setOption
setOption(string opt, auto value)
sets the given option on the type
DataProvider::AbstractDataProviderType::getReturnTypeHash
abstract hash< string, bool > getReturnTypeHash()
Returns a hash of types returned by this type; keys are type names.
DataProvider::AbstractDataProviderType::getAcceptTypeHash
abstract hash< string, bool > getAcceptTypeHash()
Returns a hash of types accepted by this type; keys are type names.
DataProvider::AbstractDataProviderType::getOptionValue
auto getOptionValue(string opt)
Returns the value of the given option.
False
const False
NothingType
const NothingType
type
string type(auto arg)
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
DataProvider::DataTypeMap
const DataTypeMap
maps Qore type name constant values to data type objects
Definition: AbstractDataProviderType.qc.dox.h:45
DataProvider::OptimalQoreDataTypeMap
const OptimalQoreDataTypeMap
maps Qore type name constant values from the Type namespace to optimal Qore types names
Definition: AbstractDataProviderType.qc.dox.h:35
DataProvider::TypeCodeMap
const TypeCodeMap
maps type codes to type names
Definition: AbstractDataProviderType.qc.dox.h:29
DataProvider::OptimalQoreSoftDataTypeMap
const OptimalQoreSoftDataTypeMap
maps Qore type name constant values from the Type namespace to optimal Qore types names
Definition: AbstractDataProviderType.qc.dox.h:41
DataProvider::DataProviderTypeOptionInfo
describes type options
Definition: AbstractDataProviderType.qc.dox.h:49
DataProvider::DataProviderTypeOptionInfo::desc
string desc
the description of the option
Definition: AbstractDataProviderType.qc.dox.h:54
DataProvider::DataProviderTypeOptionInfo::type
string type
the option value type
Definition: AbstractDataProviderType.qc.dox.h:51
DataProvider::DataTypeInfo
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:58
DataProvider::DataTypeInfo::options
*hash< auto > options
output: current transformation option values
Definition: AbstractDataProviderType.qc.dox.h:66
DataProvider::DataTypeInfo::default_field_type_info
*hash< DataTypeInfo > default_field_type_info
default type for fields not listed in fields
Definition: AbstractDataProviderType.qc.dox.h:87
DataProvider::DataTypeInfo::supported_options
*hash< string, hash< DataProviderTypeOptionInfo > > supported_options
output: transformation options supported by the type
Definition: AbstractDataProviderType.qc.dox.h:63
DataProvider::DataTypeInfo::can_manage_fields
bool can_manage_fields
if fields can be added dynamically to the type and if the type will accept any field at runtime
Definition: AbstractDataProviderType.qc.dox.h:84
DataProvider::DataTypeInfo::mandatory
bool mandatory
output: can be null / missing?
Definition: AbstractDataProviderType.qc.dox.h:72
DataProvider::DataTypeInfo::types_returned
list< string > types_returned
input: list of types returned
Definition: AbstractDataProviderType.qc.dox.h:78
DataProvider::DataTypeInfo::base_type
string base_type
output: base type
Definition: AbstractDataProviderType.qc.dox.h:69
DataProvider::DataTypeInfo::types_accepted
list< string > types_accepted
output: list of types accepted
Definition: AbstractDataProviderType.qc.dox.h:75
DataProvider::DataTypeInfo::fields
hash< string, hash< DataFieldInfo > > fields
any fields supported by the type
Definition: AbstractDataProviderType.qc.dox.h:81
DataProvider::DataTypeInfo::name
string name
the name of the type
Definition: AbstractDataProviderType.qc.dox.h:60