$darkmode

| Qore DataProvider Module Reference 2.7.1

AbstractDataField.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
27 namespace DataProvider {
29 public struct DataFieldInfo {
31 string name;
32
34 *string desc;
35
37 auto default_value;
38
40 list<auto> allowed_values;
41
43 hash<DataTypeInfo> type;
44};
45
47 class AbstractDataField : public Qore::Serializable {
48
49 public:
50 protected:
52 auto default_value;
53
55 list<auto> allowed_values;
56
58
60 hash<string, bool> allowed_values_map;
61
62 public:
63
65 bool isAssignableFrom(AbstractDataProviderType t);
66
67
69 bool isAssignableFrom(Type t);
70
71
73 bool isList();
74
75
77 bool isMandatory();
78
79
81 auto getOptionValue(string opt);
82
83
85 *hash<auto> getOptions();
86
87
89 *hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
90
91
93
98 setOption(string opt, auto value);
99
100
102
106 setOptions(hash<auto> options);
107
108
110 string getTypeName();
111
112
114 setAllowedValues(list<auto> allowed_values);
115
116
118 setDefaultValue(auto default_value);
119
120
122 auto getDefaultValue();
123
124
126 *list<auto> getAllowedValues();
127
128
130 *hash<string, bool> getAllowedValueMap();
131
132
134 bool hasType();
135
136
138
142 auto acceptsValue(auto value);
143
144
146
148 hash<DataFieldInfo> getInputInfo();
149
150
152 hash<DataFieldInfo> getInfo();
153
154
156
161 AbstractDataField getSoftType();
162
163
165
170 AbstractDataField getOrNothingType();
171
172
174 abstract string getName();
175
177 abstract *string getDescription();
178
180 abstract AbstractDataProviderType getType();
181};
182};
DataProvider::AbstractDataField
describes a data type based on a hashdecl
Definition: AbstractDataField.qc.dox.h:47
DataProvider::AbstractDataField::getOrNothingType
AbstractDataField getOrNothingType()
returns a field with an "or nothing" type equivalent to the current type
DataProvider::AbstractDataField::getOptionValue
auto getOptionValue(string opt)
returns the value of the given option on the field's type
DataProvider::AbstractDataField::getDefaultValue
auto getDefaultValue()
get default value, if any
DataProvider::AbstractDataField::setAllowedValues
setAllowedValues(list< auto > allowed_values)
Sets allowed values for enum types.
DataProvider::AbstractDataField::getSupportedOptions
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
returns supported options on the field's type
DataProvider::AbstractDataField::getTypeName
string getTypeName()
returns the type name
DataProvider::AbstractDataField::allowed_values
list< auto > allowed_values
for enum fields; raw allowed values
Definition: AbstractDataField.qc.dox.h:55
DataProvider::AbstractDataField::default_value
auto default_value
the default value for the field, if any
Definition: AbstractDataField.qc.dox.h:52
DataProvider::AbstractDataField::isMandatory
bool isMandatory()
returns True if the field's type must have a value
DataProvider::AbstractDataField::isAssignableFrom
bool isAssignableFrom(AbstractDataProviderType t)
returns True if this field's type can be assigned from values of the argument type
DataProvider::AbstractDataField::getDescription
abstract *string getDescription()
returns the description, if any
DataProvider::AbstractDataField::getName
abstract string getName()
returns the name of the field
DataProvider::AbstractDataField::getOptions
*hash< auto > getOptions()
returns options set on the field's type
DataProvider::AbstractDataField::isList
bool isList()
returns True if this field's type is a list
DataProvider::AbstractDataField::setOptions
setOptions(hash< auto > options)
sets the given options on the field's type
DataProvider::AbstractDataField::getSoftType
AbstractDataField getSoftType()
returns a field with a "soft" type equivalent to the current type
DataProvider::AbstractDataField::acceptsValue
auto acceptsValue(auto value)
returns the value if the value can be assigned to the type
DataProvider::AbstractDataField::allowed_values_map
hash< string, bool > allowed_values_map
for enum fields; allowed values
Definition: AbstractDataField.qc.dox.h:60
DataProvider::AbstractDataField::getInputInfo
hash< DataFieldInfo > getInputInfo()
returns information about the field as an input field
DataProvider::AbstractDataField::isAssignableFrom
bool isAssignableFrom(Type t)
returns True if this field's type can be assigned from values of the argument type
DataProvider::AbstractDataField::getInfo
hash< DataFieldInfo > getInfo()
returns information about the field
DataProvider::AbstractDataField::hasType
bool hasType()
returns True if the field's type is not a wildcard type
DataProvider::AbstractDataField::setDefaultValue
setDefaultValue(auto default_value)
sets the default value for the field
DataProvider::AbstractDataField::getAllowedValues
*list< auto > getAllowedValues()
Get allowed values.
DataProvider::AbstractDataField::getType
abstract AbstractDataProviderType getType()
returns the type of the field
DataProvider::AbstractDataField::setOption
setOption(string opt, auto value)
sets the given option on the field's type
DataProvider::AbstractDataField::getAllowedValueMap
*hash< string, bool > getAllowedValueMap()
Get allowed values.
DataProvider::AbstractDataProviderType
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:187
Qore::Serializable
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
DataProvider::DataFieldInfo
describes a data type
Definition: AbstractDataField.qc.dox.h:29
DataProvider::DataFieldInfo::name
string name
the name of the field
Definition: AbstractDataField.qc.dox.h:31
DataProvider::DataFieldInfo::default_value
auto default_value
the default value for the field
Definition: AbstractDataField.qc.dox.h:37
DataProvider::DataFieldInfo::type
hash< DataTypeInfo > type
type info
Definition: AbstractDataField.qc.dox.h:43
DataProvider::DataFieldInfo::allowed_values
list< auto > allowed_values
for enum fields; allowed values
Definition: AbstractDataField.qc.dox.h:40
DataProvider::DataFieldInfo::desc
*string desc
the description of the field, if available
Definition: AbstractDataField.qc.dox.h:34