| Qore DataProvider Module Reference 2.3

AbstractDataProviderType.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
27 namespace DataProvider {
29 const TypeCodeMap = ...;
30
31
33
35 const OptimalQoreDataTypeMap = ...;
36
37
39
41 const OptimalQoreSoftDataTypeMap = ...;
42
43
45 const DataTypeMap = ...;
46
47
49 const AbstractDataProviderTypeMap = ...;
50
51
53 public struct DataProviderTypeOptionInfo {
55 string type;
56
58 string desc;
59 };
60
62 public struct DataTypeInfo {
64 string name;
65
67 *hash<string, hash<DataProviderTypeOptionInfo>> supported_options;
68
70 *hash<auto> options;
71
73 string base_type;
74
76 bool mandatory;
77
79 list<string> types_accepted;
80
82 list<string> types_returned;
83
85 hash<string, hash<DataFieldInfo>> fields;
86
88 bool can_manage_fields = False;
89
91 *hash<DataTypeInfo> default_field_type_info;
92
94 *hash<auto> tags;
95 };
96
102 const DTT_FromFile = "from_file";
103
105 const DTT_FromLocation = "from_location";
106
108 const DTT_ClientOnly = "client_only";
110
112 class AbstractDataProviderType : public Serializable {
113
114 public:
115 static Type nothingType = Reflection::NothingType;
116 static Type anyType = Reflection::AutoType;
117 // not initialized here to workaround issue #4048 (circular initializtion error)
118 static AbstractDataProviderType anyDataType;
119
120 protected:
122 hash<auto> options;
123
125 *hash<auto> tags;
126
127 public:
128
130 constructor();
131
132
134
138 constructor(hash<auto> options, *hash<auto> tags);
139
140
142 *hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
143
144
146
152 hash<DataTypeInfo> getInputInfo();
153
154
156 hash<DataTypeInfo> getInfo();
157
158
160 *hash<string, hash<DataFieldInfo>> getFieldInfo();
161
162
164 bool isAssignableFrom(AbstractDataProviderType t);
165
166
168 bool isAssignableFrom(Type t);
169
170
172 bool isList();
173
174
176 bool isMandatory();
177
178
180 *AbstractDataField getField(string field_name);
181
182
184 bool hasType();
185
186
188 string getBaseTypeName();
189
190
192 int getBaseTypeCode();
193
194
196 *hash<string, bool> getDirectTypeHash();
197
198
200 bool isOrNothingType();
201
202
204 *AbstractDataProviderType getFieldType(string field_name);
205
206
208 auto getOptionValue(string opt);
209
210
212 *hash<auto> getOptions();
213
214
216
221 setOption(string opt, auto value);
222
223
225
229 setOptions(hash<auto> options);
230
231
233 auto getTag(string tag);
234
235
237 *hash<auto> getTags();
238
239
241
246 AbstractDataProviderType getSoftType();
247
248
250
257 AbstractDataProviderType getOrNothingType();
258
259
261 abstract string getName();
262
264 abstract *Type getValueType();
265
267 abstract *AbstractDataProviderType getElementType();
268
270 abstract *hash<string, AbstractDataField> getFields();
271
273 abstract hash<string, bool> getAcceptTypeHash();
274
276 abstract hash<string, bool> getReturnTypeHash();
277
279
283 abstract auto acceptsValue(auto value);
284
286 static AbstractDataProviderType get(Type type, *hash<auto> options, *hash<auto> tags);
287
289
292 static AbstractDataProviderType get(string typename, *hash<auto> options);
293
295 protected:
296 setOptionIntern(string opt, auto value);
297 public:
298
299 };
300 };
DataProvider::AbstractDataField
describes a data type based on a hashdecl
Definition: AbstractDataField.qc.dox.h:47
DataProvider::AbstractDataProviderType
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:112
DataProvider::AbstractDataProviderType::hasType
bool hasType()
Returns True if the type is not a wildcard type.
DataProvider::AbstractDataProviderType::getFieldInfo
*hash< string, hash< DataFieldInfo > > getFieldInfo()
Returns information on fields supported.
DataProvider::AbstractDataProviderType::getBaseTypeCode
int getBaseTypeCode()
Returns the base type code for the type.
DataProvider::AbstractDataProviderType::tags
*hash< auto > tags
type tags
Definition: AbstractDataProviderType.qc.dox.h:125
DataProvider::AbstractDataProviderType::isAssignableFrom
bool isAssignableFrom(AbstractDataProviderType t)
Returns True if this type can be assigned from values of the argument type.
DataProvider::AbstractDataProviderType::getFieldType
*AbstractDataProviderType getFieldType(string field_name)
get the given field type if it exists, otherwise return NOTHING
DataProvider::AbstractDataProviderType::options
hash< auto > options
type options
Definition: AbstractDataProviderType.qc.dox.h:122
DataProvider::AbstractDataProviderType::getInfo
hash< DataTypeInfo > getInfo()
Returns a description of the type as a hash.
DataProvider::AbstractDataProviderType::isAssignableFrom
bool isAssignableFrom(Type t)
Returns True if this type can be assigned from values of the argument type.
DataProvider::AbstractDataProviderType::getElementType
abstract *AbstractDataProviderType getElementType()
Returns the subtype (for lists or hashes) if there is only one.
DataProvider::AbstractDataProviderType::getDirectTypeHash
*hash< string, bool > getDirectTypeHash()
Returns a hash of native base type code keys where no translations are performed; keys are type codes...
DataProvider::AbstractDataProviderType::getInputInfo
hash< DataTypeInfo > getInputInfo()
Returns a description of the type as an input type.
DataProvider::AbstractDataProviderType::isMandatory
bool isMandatory()
Returns True if the type must have a value.
DataProvider::AbstractDataProviderType::isList
bool isList()
Returns True if this type is a list.
DataProvider::AbstractDataProviderType::getBaseTypeName
string getBaseTypeName()
Returns the base type name for the type; must be a standard Qore base type name.
DataProvider::AbstractDataProviderType::isOrNothingType
bool isOrNothingType()
Returns True if the type also accepts NOTHING.
DataProvider::AbstractDataProviderType::acceptsValue
abstract auto acceptsValue(auto value)
Returns the value if the value can be assigned to the type.
DataProvider::AbstractDataProviderType::get
static AbstractDataProviderType get(string typename, *hash< auto > options)
Returns an appropriate object for the given type.
DataProvider::AbstractDataProviderType::getSupportedOptions
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
Returns supported options.
DataProvider::AbstractDataProviderType::getOrNothingType
AbstractDataProviderType getOrNothingType()
Returns an "or nothing" type equivalent to the current type.
DataProvider::AbstractDataProviderType::getName
abstract string getName()
Returns the type name.
DataProvider::AbstractDataProviderType::getFields
abstract *hash< string, AbstractDataField > getFields()
Returns the fields of the data structure; if any.
DataProvider::AbstractDataProviderType::setOptionIntern
setOptionIntern(string opt, auto value)
sets the given option without any validation of the option
DataProvider::AbstractDataProviderType::setOptions
setOptions(hash< auto > options)
sets options on the type
DataProvider::AbstractDataProviderType::getValueType
abstract *Type getValueType()
Returns the base type for the type, if any.
DataProvider::AbstractDataProviderType::getField
*AbstractDataField getField(string field_name)
Returns the given field, if present, or NOTHING if not.
DataProvider::AbstractDataProviderType::getOptions
*hash< auto > getOptions()
Returns options set on the type.
DataProvider::AbstractDataProviderType::constructor
constructor(hash< auto > options, *hash< auto > tags)
creates the type and sets options
DataProvider::AbstractDataProviderType::constructor
constructor()
creates the type
DataProvider::AbstractDataProviderType::getSoftType
AbstractDataProviderType getSoftType()
Returns a "soft" type equivalent to the current type.
DataProvider::AbstractDataProviderType::setOption
setOption(string opt, auto value)
sets the given option on the type
DataProvider::AbstractDataProviderType::getReturnTypeHash
abstract hash< string, bool > getReturnTypeHash()
Returns a hash of types returned by this type; keys are type names.
DataProvider::AbstractDataProviderType::getTags
*hash< auto > getTags()
Returns tags set on the type.
DataProvider::AbstractDataProviderType::getAcceptTypeHash
abstract hash< string, bool > getAcceptTypeHash()
Returns a hash of types accepted by this type; keys are type names.
DataProvider::AbstractDataProviderType::get
static AbstractDataProviderType get(Type type, *hash< auto > options, *hash< auto > tags)
Returns an appropriate object for the given type.
DataProvider::AbstractDataProviderType::getOptionValue
auto getOptionValue(string opt)
Returns the value of the given option.
DataProvider::AbstractDataProviderType::getTag
auto getTag(string tag)
Returns the value of the given tag.
False
const False
NothingType
const NothingType
type
string type(auto arg)
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
DataProvider::DataTypeMap
const DataTypeMap
Maps Qore type name constant values to data type objects.
Definition: AbstractDataProviderType.qc.dox.h:45
DataProvider::DTT_FromLocation
const DTT_FromLocation
Tag indicates that a string value can indicate a location.
Definition: AbstractDataProviderType.qc.dox.h:105
DataProvider::OptimalQoreDataTypeMap
const OptimalQoreDataTypeMap
maps Qore type name constant values from the Type namespace to optimal Qore types names
Definition: AbstractDataProviderType.qc.dox.h:35
DataProvider::TypeCodeMap
const TypeCodeMap
maps type codes to type names
Definition: AbstractDataProviderType.qc.dox.h:29
DataProvider::DTT_FromFile
const DTT_FromFile
Tag indicating that a string value can be taken from a file.
Definition: AbstractDataProviderType.qc.dox.h:102
DataProvider::AbstractDataProviderTypeMap
const AbstractDataProviderTypeMap
Maps Qore type name constant values to AbstractDataProviderType values.
Definition: AbstractDataProviderType.qc.dox.h:49
DataProvider::OptimalQoreSoftDataTypeMap
const OptimalQoreSoftDataTypeMap
maps Qore type name constant values from the Type namespace to optimal Qore types names
Definition: AbstractDataProviderType.qc.dox.h:41
DataProvider::DTT_ClientOnly
const DTT_ClientOnly
Tag indicates that the value is only applicable in client contexts.
Definition: AbstractDataProviderType.qc.dox.h:108
DataProvider::DataProviderTypeOptionInfo
describes type options
Definition: AbstractDataProviderType.qc.dox.h:53
DataProvider::DataProviderTypeOptionInfo::desc
string desc
the description of the option
Definition: AbstractDataProviderType.qc.dox.h:58
DataProvider::DataProviderTypeOptionInfo::type
string type
the option value type
Definition: AbstractDataProviderType.qc.dox.h:55
DataProvider::DataTypeInfo
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:62
DataProvider::DataTypeInfo::options
*hash< auto > options
output: current transformation option values
Definition: AbstractDataProviderType.qc.dox.h:70
DataProvider::DataTypeInfo::tags
*hash< auto > tags
Any tags set on the type.
Definition: AbstractDataProviderType.qc.dox.h:94
DataProvider::DataTypeInfo::default_field_type_info
*hash< DataTypeInfo > default_field_type_info
default type for fields not listed in fields
Definition: AbstractDataProviderType.qc.dox.h:91
DataProvider::DataTypeInfo::supported_options
*hash< string, hash< DataProviderTypeOptionInfo > > supported_options
output: transformation options supported by the type
Definition: AbstractDataProviderType.qc.dox.h:67
DataProvider::DataTypeInfo::can_manage_fields
bool can_manage_fields
if fields can be added dynamically to the type and if the type will accept any field at runtime
Definition: AbstractDataProviderType.qc.dox.h:88
DataProvider::DataTypeInfo::mandatory
bool mandatory
output: can be null / missing?
Definition: AbstractDataProviderType.qc.dox.h:76
DataProvider::DataTypeInfo::types_returned
list< string > types_returned
input: list of types returned
Definition: AbstractDataProviderType.qc.dox.h:82
DataProvider::DataTypeInfo::base_type
string base_type
output: base type
Definition: AbstractDataProviderType.qc.dox.h:73
DataProvider::DataTypeInfo::types_accepted
list< string > types_accepted
output: list of types accepted
Definition: AbstractDataProviderType.qc.dox.h:79
DataProvider::DataTypeInfo::fields
hash< string, hash< DataFieldInfo > > fields
any fields supported by the type
Definition: AbstractDataProviderType.qc.dox.h:85
DataProvider::DataTypeInfo::name
string name
the name of the type
Definition: AbstractDataProviderType.qc.dox.h:64