Qore DataProvider Module Reference 3.1
Loading...
Searching...
No Matches
HashDataType.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
26namespace DataProvider {
28
36class HashDataType : public QoreDataType {
37
38public:
39protected:
41 hash<string, AbstractDataField> fields;
42
45 AbstractDataProviderType::get(AbstractDataProviderType::anyType);
46
49
52
55
56public:
57
59 constructor(string name = AutoHashType.getName(), *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
60 ;
61
62
64 constructor(Type base_type, *string name, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
65 ;
66
67
69 constructor(Type base_type, *string name, hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
70 ;
71
72
74 constructor(string name = AutoHashType.getName(), hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
75 ;
76
77
79 constructor(Qore::Reflection::TypedHash t, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
80 ;
81
82
84 HashDataType copyWithFields(hash<string, AbstractDataField> fields);
85
86
89
90
93
94
97
98
101
102
104
111 *hash<auto> getDefaultValue();
112
113
115
121 auto acceptsValue(auto input_value);
122
123
125
129
130
132
137 HashDataType addQoreFields(hash<auto> new_fields);
138
139
142
143
145 HashDataType addField(Qore::Reflection::TypedHashMember mem);
146
147
150
151
154
155
158
159
161 *hash<string, AbstractDataField> getFields();
162
163
165
168
169
171 hash<DataTypeInfo> getInfo(*bool simple);
172
173
175
178
179
181
186protected:
188public:
189
190
192protected:
194public:
195
196
198protected:
199 addFieldIntern(Qore::Reflection::TypedHashMember mem);
200public:
201
202};
203};
describes a data type based on a hashdecl
Definition AbstractDataField.qc.dox.h:74
describes a data type
Definition AbstractDataProviderType.qc.dox.h:139
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.
*hash< auto > tags
type tags
Definition AbstractDataProviderType.qc.dox.h:155
hash< auto > options
type options
Definition AbstractDataProviderType.qc.dox.h:152
describes a data type based on a hash
Definition HashDataType.qc.dox.h:36
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
HashDataType replaceField(AbstractDataField field)
Replaces an existing field with a new definition.
postProcessAddedField(AbstractDataField field)
Post process added fields.
bool manual_default_other_field_type
default other field type set mamnually?
Definition HashDataType.qc.dox.h:48
AbstractDataProviderType getDeepOrNothingType()
Returns an "or nothing" type equivalent to the current type as well as all fields.
HashDataType copyWithFields(hash< string, AbstractDataField > fields)
Copy and set new fields in the copy.
*AbstractDataProviderType getDefaultOtherFieldType()
Returns the default field type for undeclared fields, if any.
bool isAssignableFrom(AbstractDataProviderType t)
Returns True if this type can be assigned from values of the argument type.
hash< string, AbstractDataField > fields
Fields.
Definition HashDataType.qc.dox.h:41
*AbstractDataField getField(string name)
Returns the given field, if present, or NOTHING if not.
HashDataType addField(AbstractDataField field)
Adds a field to the type.
checkConvertOrNothing()
Convert to an "or-nothing" type if all fields are optional.
setDefaultOtherFieldType(*AbstractDataProviderType default_other_field_type)
Sets the default field type for unlisted fields.
bool has_default_other_field_type
if the type requires validation
Definition HashDataType.qc.dox.h:51
addFieldIntern(Qore::Reflection::TypedHashMember mem)
adds a field to the type from a typed hash member
*hash< string, AbstractDataField > getFields()
Returns the fields of the data structure; if any.
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
addFieldIntern(AbstractDataField field)
adds a field to the type
bool default_value_needs_check
if the default value should be validated
Definition HashDataType.qc.dox.h:54
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
AbstractDataProviderType getSoftType()
Returns a "soft" type equivalent to the current type.
HashDataType addOrReplaceField(AbstractDataField field)
Adds or replaces a field with a new definition.
*hash< auto > getDefaultValue()
HashDataType addField(Qore::Reflection::TypedHashMember mem)
Adds a field to the type from a typed hash member.
HashDataType addQoreFields(hash< auto > new_fields)
Adds a set of fields from a hash.
*AbstractDataProviderType default_other_field_type
allow other fields
Definition HashDataType.qc.dox.h:44
auto acceptsValue(auto input_value)
Returns the value if the value can be assigned to the type.
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
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
hash< DataTypeInfo > getInfo(*bool simple)
returns a description of the type as a hash
bool hasDefaultOtherFieldType()
Returns True if the type has a default field type for undeclared fields.
describes a data type based on a Qore data type
Definition QoreDataType.qc.dox.h:46
auto default_value
Default value for type.
Definition QoreDataType.qc.dox.h:72
string name
The name of the type; if not set then the name of "type" is used instead.
Definition QoreDataType.qc.dox.h:54
Qore AbstractDataField class definition.
Definition AbstractDataField.qc.dox.h:27