Qore DataProvider Module Reference 3.0
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
53public:
54
56 constructor(string name = AutoHashType.getName(), *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
57 ;
58
59
61 constructor(Type base_type, *string name, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
62 ;
63
64
66 constructor(Type base_type, *string name, hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
67 ;
68
69
71 constructor(string name = AutoHashType.getName(), hash<string, AbstractDataField> fields, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
72 ;
73
74
76 constructor(Qore::Reflection::TypedHash t, *hash<auto> options, *hash<auto> tags, *hash<auto> default_value, *hash<NameDescInfo> attr)
77 ;
78
79
81 HashDataType copyWithFields(hash<string, AbstractDataField> fields);
82
83
86
87
90
91
94
95
98
99
101
107 auto acceptsValue(auto input_value);
108
109
111
115
116
118
123 HashDataType addQoreFields(hash<auto> new_fields);
124
125
128
129
131 HashDataType addField(Qore::Reflection::TypedHashMember mem);
132
133
136
137
140
141
144
145
147 *hash<string, AbstractDataField> getFields();
148
149
151
154
155
157 hash<DataTypeInfo> getInfo(*bool simple);
158
159
161
164
165
167
172protected:
174public:
175
176
178protected:
180public:
181
182
184protected:
185 addFieldIntern(Qore::Reflection::TypedHashMember mem);
186public:
187
188};
189};
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
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.
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