Qore DataProvider Module Reference 3.2.2
Loading...
Searching...
No Matches
HashDataType.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
24
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
58
59public:
60
62 constructor(string name = AutoHashType.getName(), *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
63 ;
64
65
67 constructor(Type base_type, *string name, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
68 ;
69
70
72 constructor(Type base_type, *string name, hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
73 ;
74
75
77 constructor(string name = AutoHashType.getName(), hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
78 ;
79
80
82 constructor(Qore::Reflection::TypedHash t, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
83 ;
84
85
87 HashDataType copyWithFields(hash<string, AbstractDataField> fields);
88
89
92
93
96
97
100
101
104
105
107
114 *hash<auto> getDefaultValue();
115
116
118
124 auto acceptsValue(auto input_value);
125
126
128
132
133
135
140 HashDataType addQoreFields(hash<auto> new_fields);
141
142
145
146
148 HashDataType addField(Qore::Reflection::TypedHashMember mem);
149
150
153
154
157
158
161
162
164 *hash<string, AbstractDataField> getFields();
165
166
168
171
172
174 hash<DataTypeInfo> getInfo(*bool simple);
175
176
178
181
182
184
189protected:
191public:
192
193
195protected:
197public:
198
199
201protected:
202 addFieldIntern(Qore::Reflection::TypedHashMember mem);
203public:
204
205
207protected:
209public:
210
211};
212};
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
scanFieldsForRequired()
Set the "required_fields" flag if any fields are mandatory.
bool required_fields
Are any fields required?
Definition HashDataType.qc.dox.h:57
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