Qore DataProvider Module Reference  2.0
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 
51  AbstractDataProviderType::get(AbstractDataProviderType::anyType);
52 
55 
56 public:
57 
59  constructor(string name = AutoHashType.getName(), *hash<auto> options) ;
60 
61 
63  constructor(Type base_type, *string name, *hash<auto> options) ;
64 
65 
67  constructor(string name = AutoHashType.getName(), hash<string, AbstractDataField> fields, *hash<auto> options)
68  ;
69 
70 
73 
74 
76  string getName();
77 
78 
80 
86  auto acceptsValue(auto value);
87 
88 
90 
94 
95 
98 
99 
102 
103 
105  *hash<string, AbstractDataField> getFields();
106 
107 
109 
112 
113 
115  hash<DataTypeInfo> getInfo();
116 
117 
119 
122 
123 };
124 };
describes a data type based on a hashdecl
Definition: AbstractDataField.qc.dox.h:44
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:91
hash< auto > options
type options
Definition: AbstractDataProviderType.qc.dox.h:101
static AbstractDataProviderType get(Type type, *hash< auto > options)
Returns an appropriate object for the given type.
describes a data type based on a hash
Definition: HashDataType.qc.dox.h:39
constructor(string name=AutoHashType.getName(), hash< string, AbstractDataField > fields, *hash< auto > options)
creates the object from the given record description and assigns the name as the type
AbstractDataProviderType getOrNothingType()
Returns an "or nothing" type equivalent to the current type.
addField(AbstractDataField field)
adds a field to the type
bool isAssignableFrom(AbstractDataProviderType t)
Returns True if this type can be assigned from values of the argument type.
*hash< string, AbstractDataField > getFields()
Returns the fields of the data structure; if any.
hash< string, AbstractDataField > fields
fields
Definition: HashDataType.qc.dox.h:47
*AbstractDataField getField(string name)
Returns the given field, if present, or NOTHING if not.
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:54
constructor(Type base_type, *string name, *hash< auto > options)
creates the object and assigns the name as the given name or the base type's name
string getName()
Returns the type name.
AbstractDataProviderType getSoftType()
Returns a "soft" type equivalent to the current type.
string name
the name of the type
Definition: HashDataType.qc.dox.h:44
auto acceptsValue(auto value)
Returns the value if the value can be assigned to the type.
constructor(string name=AutoHashType.getName(), *hash< auto > options)
creates the object and assigns the name as the type
*AbstractDataProviderType default_other_field_type
allow other fields
Definition: HashDataType.qc.dox.h:50
hash< DataTypeInfo > getInfo()
returns a description of the type as a hash
describes a data type based on a Qore data type
Definition: QoreDataType.qc.dox.h:37
const False
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27