| Qore DataProvider Module Reference 1.2.1

HashDataType.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
25 // assume local scope for variables, do not use "$" signs
26 // require type definitions everywhere
28 // enable all warnings
29
30
32 namespace DataProvider {
34
39 class HashDataType : public QoreDataType {
40
41 public:
42 protected:
44 string name;
45
47 hash<string, AbstractDataField> fields;
48
50 *AbstractDataProviderType default_other_field_type = AbstractDataProviderType::get(AbstractDataProviderType::anyType);
51
53 bool has_default_other_field_type = False;
54
55 public:
56
58 constructor(string name = AutoHashType.getName(), *hash<auto> options) ;
59
60
62 constructor(Type base_type, *string name, *hash<auto> options) ;
63
64
66 constructor(string name = AutoHashType.getName(), hash<string, AbstractDataField> fields, *hash<auto> options)
67 ;
68
69
71 setDefaultOtherFieldType(*AbstractDataProviderType default_other_field_type);
72
73
75 string getName();
76
77
79
85 auto acceptsValue(auto value);
86
87
89
92 bool isAssignableFrom(AbstractDataProviderType t);
93
94
96 addField(AbstractDataField field);
97
98
100 *AbstractDataField getField(string name);
101
102
104 *hash<string, AbstractDataField> getFields();
105
106
108
110 AbstractDataProviderType getSoftType();
111
112
114
116 AbstractDataProviderType getOrNothingType();
117
118 };
119 };
DataProvider::HashDataType::isAssignableFrom
bool isAssignableFrom(AbstractDataProviderType t)
Returns True if this type can be assigned from values of the argument type.
DataProvider::HashDataType::getName
string getName()
Returns the type name.
DataProvider::HashDataType::addField
addField(AbstractDataField field)
adds a field to the type
DataProvider::AbstractDataProviderType::get
static AbstractDataProviderType get(Type type, *hash< auto > options)
Returns an appropriate object for the given type.
DataProvider::HashDataType::acceptsValue
auto acceptsValue(auto value)
Returns the value if the value can be assigned to the type.
False
const False
DataProvider::HashDataType::name
string name
the name of the type
Definition: HashDataType.qc.dox.h:44
DataProvider::HashDataType::getSoftType
AbstractDataProviderType getSoftType()
Returns a "soft" type equivalent to the current type.
DataProvider::HashDataType::getOrNothingType
AbstractDataProviderType getOrNothingType()
Returns an "or nothing" type equivalent to the current type.
DataProvider::AbstractDataProviderType::options
hash< auto > options
type options
Definition: AbstractDataProviderType.qc.dox.h:98
DataProvider::AbstractDataProviderType
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:88
DataProvider::HashDataType::default_other_field_type
*AbstractDataProviderType default_other_field_type
allow other fields
Definition: HashDataType.qc.dox.h:50
DataProvider::HashDataType
describes a data type based on a hash
Definition: HashDataType.qc.dox.h:39
DataProvider::AbstractDataField
describes a data type based on a hashdecl
Definition: AbstractDataField.qc.dox.h:44
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
DataProvider::HashDataType::setDefaultOtherFieldType
setDefaultOtherFieldType(*AbstractDataProviderType default_other_field_type)
Sets the default field type for unlisted fields.
DataProvider::HashDataType::fields
hash< string, AbstractDataField > fields
fields
Definition: HashDataType.qc.dox.h:47
DataProvider::HashDataType::has_default_other_field_type
bool has_default_other_field_type
if the type requires validation
Definition: HashDataType.qc.dox.h:53
DataProvider::HashDataType::getFields
*hash< string, AbstractDataField > getFields()
Returns the fields of the data structure; if any.
DataProvider::HashDataType::getField
*AbstractDataField getField(string name)
Returns the given field, if present, or NOTHING if not.
DataProvider::QoreDataType
describes a data type based on a Qore data type
Definition: QoreDataType.qc.dox.h:37
DataProvider::AbstractDataProviderType::constructor
constructor()
creates the type