| Qore DataProvider Module Reference 3.2.2

Loading...
Searching...
No Matches
HashDataType.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
24
26 namespace DataProvider {
28
36 class HashDataType : public QoreDataType {
37
38 public:
39 protected:
41 hash<string, AbstractDataField> fields;
42
44 *AbstractDataProviderType default_other_field_type =
45 AbstractDataProviderType::get(AbstractDataProviderType::anyType);
46
48 bool manual_default_other_field_type = False;
49
51 bool has_default_other_field_type = False;
52
54 bool default_value_needs_check;
55
57 bool required_fields;
58
59 public:
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
91 setDefaultOtherFieldType(*AbstractDataProviderType default_other_field_type);
92
93
95 bool hasDefaultOtherFieldType();
96
97
99 *AbstractDataProviderType getDefaultOtherFieldType();
100
101
103 checkConvertOrNothing();
104
105
107
114 *hash<auto> getDefaultValue();
115
116
118
124 auto acceptsValue(auto input_value);
125
126
128
131 bool isAssignableFrom(AbstractDataProviderType t);
132
133
135
140 HashDataType addQoreFields(hash<auto> new_fields);
141
142
144 HashDataType addField(AbstractDataField field);
145
146
148 HashDataType addField(Qore::Reflection::TypedHashMember mem);
149
150
152 HashDataType replaceField(AbstractDataField field);
153
154
156 HashDataType addOrReplaceField(AbstractDataField field);
157
158
160 *AbstractDataField getField(string name);
161
162
164 *hash<string, AbstractDataField> getFields();
165
166
168
170 AbstractDataProviderType getSoftType();
171
172
174 hash<DataTypeInfo> getInfo(*bool simple);
175
176
178
180 AbstractDataProviderType getDeepOrNothingType();
181
182
184
189 protected:
190 postProcessAddedField(AbstractDataField field);
191 public:
192
193
195 protected:
196 addFieldIntern(AbstractDataField field);
197 public:
198
199
201 protected:
202 addFieldIntern(Qore::Reflection::TypedHashMember mem);
203 public:
204
205
207 protected:
208 scanFieldsForRequired();
209 public:
210
211};
212};
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::scanFieldsForRequired
scanFieldsForRequired()
Set the "required_fields" flag if any fields are mandatory.
DataProvider::HashDataType::required_fields
bool required_fields
Are any fields required?
Definition HashDataType.qc.dox.h:57
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