Loading...
Searching...
No Matches
HashDataType.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace DataProvider {
class HashDataType : public QoreDataType {
public:
protected:
hash<string, AbstractDataField> fields;
*AbstractDataProviderType default_other_field_type =
AbstractDataProviderType::get(AbstractDataProviderType::anyType);
bool manual_default_other_field_type = False;
bool has_default_other_field_type = False;
bool default_value_needs_check;
public:
constructor(string name = AutoHashType.getName(), *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
;
constructor(Type base_type, *string name, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
;
constructor(Type base_type, *string name, hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
;
constructor(string name = AutoHashType.getName(), hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
;
constructor(Qore::Reflection::TypedHash t, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
;
HashDataType copyWithFields(hash<string, AbstractDataField> fields);
setDefaultOtherFieldType(*AbstractDataProviderType default_other_field_type);
bool hasDefaultOtherFieldType();
*AbstractDataProviderType getDefaultOtherFieldType();
checkConvertOrNothing();
*hash<auto> getDefaultValue();
auto acceptsValue(auto input_value);
bool isAssignableFrom(AbstractDataProviderType t);
HashDataType addQoreFields(hash<auto> new_fields);
HashDataType addField(AbstractDataField field);
HashDataType addField(Qore::Reflection::TypedHashMember mem);
HashDataType replaceField(AbstractDataField field);
HashDataType addOrReplaceField(AbstractDataField field);
*AbstractDataField getField(string name);
*hash<string, AbstractDataField> getFields();
AbstractDataProviderType getSoftType();
hash<DataTypeInfo> getInfo(*bool simple);
AbstractDataProviderType getDeepOrNothingType();
protected:
postProcessAddedField(AbstractDataField field);
public:
protected:
addFieldIntern(AbstractDataField field);
public:
protected:
addFieldIntern(Qore::Reflection::TypedHashMember mem);
public:
};
};
DataProvider::AbstractDataField
describes a data type based on a hashdecl
Definition AbstractDataField.qc.dox.h:74
DataProvider::AbstractDataProviderType
describes a data type
Definition AbstractDataProviderType.qc.dox.h:139
DataProvider::AbstractDataProviderType::get
static AbstractDataProviderType get(Type type, *hash< auto > options, *hash< auto > tags, auto default_value, *hash< NameDescInfo > attr)
Returns an appropriate object for the given type.
DataProvider::AbstractDataProviderType::tags
*hash< auto > tags
type tags
Definition AbstractDataProviderType.qc.dox.h:155
DataProvider::AbstractDataProviderType::options
hash< auto > options
type options
Definition AbstractDataProviderType.qc.dox.h:152
DataProvider::HashDataType
describes a data type based on a hash
Definition HashDataType.qc.dox.h:36
DataProvider::HashDataType::constructor
constructor(string name=AutoHashType.getName(), *hash< auto > options, *hash< auto > tags, *hash< auto > default_value, *hash< NameDescInfo > attr)
creates the object and assigns the name as the type
DataProvider::HashDataType::replaceField
HashDataType replaceField(AbstractDataField field)
Replaces an existing field with a new definition.
DataProvider::HashDataType::postProcessAddedField
postProcessAddedField(AbstractDataField field)
Post process added fields.
DataProvider::HashDataType::manual_default_other_field_type
bool manual_default_other_field_type
default other field type set mamnually?
Definition HashDataType.qc.dox.h:48
DataProvider::HashDataType::getDeepOrNothingType
AbstractDataProviderType getDeepOrNothingType()
Returns an "or nothing" type equivalent to the current type as well as all fields.
DataProvider::HashDataType::copyWithFields
HashDataType copyWithFields(hash< string, AbstractDataField > fields)
Copy and set new fields in the copy.
DataProvider::HashDataType::getDefaultOtherFieldType
*AbstractDataProviderType getDefaultOtherFieldType()
Returns the default field type for undeclared fields, if any.
DataProvider::HashDataType::isAssignableFrom
bool isAssignableFrom(AbstractDataProviderType t)
Returns True if this type can be assigned from values of the argument type.
DataProvider::HashDataType::fields
hash< string, AbstractDataField > fields
Fields.
Definition HashDataType.qc.dox.h:41
DataProvider::HashDataType::getField
*AbstractDataField getField(string name)
Returns the given field, if present, or nothing if not.
DataProvider::HashDataType::addField
HashDataType addField(AbstractDataField field)
Adds a field to the type.
DataProvider::HashDataType::checkConvertOrNothing
checkConvertOrNothing()
Convert to an "or-nothing" type if all fields are optional.
DataProvider::HashDataType::setDefaultOtherFieldType
setDefaultOtherFieldType(*AbstractDataProviderType default_other_field_type)
Sets the default field type for unlisted fields.
DataProvider::HashDataType::has_default_other_field_type
bool has_default_other_field_type
if the type requires validation
Definition HashDataType.qc.dox.h:51
DataProvider::HashDataType::addFieldIntern
addFieldIntern(Qore::Reflection::TypedHashMember mem)
adds a field to the type from a typed hash member
DataProvider::HashDataType::getFields
*hash< string, AbstractDataField > getFields()
Returns the fields of the data structure; if any.
DataProvider::HashDataType::constructor
constructor(Type base_type, *string name, *hash< auto > options, *hash< auto > tags, *hash< auto > default_value, *hash< NameDescInfo > attr)
creates the object and assigns the name as the given name or the base type's name
DataProvider::HashDataType::addFieldIntern
addFieldIntern(AbstractDataField field)
adds a field to the type
DataProvider::HashDataType::default_value_needs_check
bool default_value_needs_check
if the default value should be validated
Definition HashDataType.qc.dox.h:54
DataProvider::HashDataType::constructor
constructor(Qore::Reflection::TypedHash t, *hash< auto > options, *hash< auto > tags, *hash< auto > default_value, *hash< NameDescInfo > attr)
creates the object from the given TypedHash
DataProvider::HashDataType::getSoftType
AbstractDataProviderType getSoftType()
Returns a "soft" type equivalent to the current type.
DataProvider::HashDataType::addOrReplaceField
HashDataType addOrReplaceField(AbstractDataField field)
Adds or replaces a field with a new definition.
DataProvider::HashDataType::getDefaultValue
*hash< auto > getDefaultValue()
DataProvider::HashDataType::addField
HashDataType addField(Qore::Reflection::TypedHashMember mem)
Adds a field to the type from a typed hash member.
DataProvider::HashDataType::addQoreFields
HashDataType addQoreFields(hash< auto > new_fields)
Adds a set of fields from a hash.
DataProvider::HashDataType::default_other_field_type
*AbstractDataProviderType default_other_field_type
allow other fields
Definition HashDataType.qc.dox.h:44
DataProvider::HashDataType::acceptsValue
auto acceptsValue(auto input_value)
Returns the value if the value can be assigned to the type.
DataProvider::HashDataType::constructor
constructor(string name=AutoHashType.getName(), hash< string, AbstractDataField > fields, *hash< auto > options, *hash< auto > tags, *hash< auto > default_value, *hash< NameDescInfo > attr)
creates the object from the given record description and assigns the name as the type
DataProvider::HashDataType::constructor
constructor(Type base_type, *string name, hash< string, AbstractDataField > fields, *hash< auto > options, *hash< auto > tags, *hash< auto > default_value, *hash< NameDescInfo > attr)
creates the object and assigns the name as the given name or the base type's name
DataProvider::HashDataType::getInfo
hash< DataTypeInfo > getInfo(*bool simple)
returns a description of the type as a hash
DataProvider::HashDataType::hasDefaultOtherFieldType
bool hasDefaultOtherFieldType()
Returns True if the type has a default field type for undeclared fields.
DataProvider::QoreDataType
describes a data type based on a Qore data type
Definition QoreDataType.qc.dox.h:46
DataProvider::QoreDataType::default_value
auto default_value
Default value for type.
Definition QoreDataType.qc.dox.h:72
DataProvider::QoreDataType::name
string name
The name of the type; if not set then the name of "type" is used instead.
Definition QoreDataType.qc.dox.h:54
DataProvider
Qore AbstractDataField class definition.
Definition AbstractDataField.qc.dox.h:27