| Qore DataProvider Module Reference 3.2.2

Loading...
Searching...
No Matches
AbstractDataField.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
24
25
27 namespace DataProvider {
29 public struct DataFieldInfo {
31 string name;
32
34 string display_name;
35
37 *string short_desc;
38
40 *string desc;
41
43 auto default_value;
44
46 auto example_value;
47
49 bool multiselect;
50
52 *list<hash<AllowedValueInfo>> allowed_values;
53
55 *bool allowed_values_creatable;
56
58 *list<hash<AllowedValueInfo>> element_allowed_values;
59
61 *bool element_allowed_values_creatable;
62
64 hash<DataTypeInfo> type;
65
67 string unique_key;
68
70 *hash<auto> attr;
71};
72
74 class AbstractDataField : public Qore::Serializable {
75
76 public:
77 protected:
79 auto default_value;
80
82 bool multiselect;
83
85 list<hash<AllowedValueInfo>> allowed_values;
86
88 *bool allowed_values_creatable;
89
91 *list<hash<AllowedValueInfo>> element_allowed_values;
92
94 *bool element_allowed_values_creatable;
95
97
99 hash<string, bool> allowed_values_map;
100
102
104 hash<string, bool> element_allowed_values_map;
105
107 hash<auto> attr;
108
109 public:
110
112 bool isAssignableFrom(AbstractDataProviderType t);
113
114
116 bool isAssignableFrom(Type t);
117
118
120 bool isList();
121
122
124 bool isMandatory();
125
126
128 bool isMultiselect();
129
130
132 auto getOptionValue(string opt);
133
134
136 *hash<auto> getOptions();
137
138
140 *hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
141
142
144
149 AbstractDataField setOption(string opt, auto value);
150
151
153
157 AbstractDataField setOptions(hash<auto> options);
158
159
161 string getTypeName();
162
163
165 AbstractDataField setAllowedValues(list<auto> allowed_values, *bool allowed_values_creatable);
166
167
169 AbstractDataField setElementAllowedValues(list<auto> element_allowed_values, *bool element_allowed_values_creatable);
170
171
173 AbstractDataField setDefaultValue(auto default_value);
174
175
177 auto getDefaultValue();
178
179
181 *list<hash<AllowedValueInfo>> getAllowedValues();
182
183
185 *hash<string, bool> getAllowedValueMap();
186
187
189 bool getAllowedValuesCreatable();
190
191
193 *list<hash<AllowedValueInfo>> getElementAllowedValues();
194
195
197 *hash<string, bool> getElementAllowedValueMap();
198
199
201 bool getElementAllowedValuesCreatable();
202
203
205 bool hasType();
206
207
209
213 auto acceptsValue(auto value);
214
215
217
220 hash<DataFieldInfo> getInputInfo();
221
222
224 hash<DataFieldInfo> getInfo();
225
226
228 hash<DataFieldInfo> getLocalInfo();
229
230
232 hash<DataFieldInfo> getConfigInfo();
233
234
236
241 AbstractDataField getSoftType();
242
243
245
250 AbstractDataField getOrNothingType();
251
252
254
261 AbstractDataField getMandatoryType();
262
263
265 string getDisplayName();
266
267
269 *string getShortDescription();
270
271
273 *hash<auto> getAttributes();
274
275
277 AbstractDataField setAttributes(hash<auto> attr);
278
279
281 replaceAttributes(*hash<auto> attr);
282
283
285
292 auto getExampleValue(*hash<string, bool> emap, *string fname);
293
294
296 static *string getShortDescription(*string desc, *int maxlen);
297
299 static string getDisplayName(string name);
300
302 static string getNameFromDisplayName(string display_name);
303
305 abstract string getName();
306
308 abstract *string getDescription();
309
311 abstract AbstractDataProviderType getType();
312};
313};
DataProvider::AbstractDataField
describes a data type based on a hashdecl
Definition AbstractDataField.qc.dox.h:74
DataProvider::AbstractDataField::multiselect
bool multiselect
Are allowed values elements of the list's element type that indicate what values the list can have?
Definition AbstractDataField.qc.dox.h:82
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::allowed_values_creatable
*bool allowed_values_creatable
Does the field accept values not defined in allowed_values too?
Definition AbstractDataField.qc.dox.h:88
DataProvider::AbstractDataField::getNameFromDisplayName
static string getNameFromDisplayName(string display_name)
Converts a display name into a technical name.
DataProvider::AbstractDataField::getConfigInfo
hash< DataFieldInfo > getConfigInfo()
returns information about the field
DataProvider::AbstractDataField::setAllowedValues
AbstractDataField setAllowedValues(list< auto > allowed_values, *bool allowed_values_creatable)
Sets allowed values for enum types.
DataProvider::AbstractDataField::getDefaultValue
auto getDefaultValue()
get default value, if any
DataProvider::AbstractDataField::getAllowedValuesCreatable
bool getAllowedValuesCreatable()
Get the "allowed values creatable" flag.
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::default_value
auto default_value
the default value for the field, if any
Definition AbstractDataField.qc.dox.h:79
DataProvider::AbstractDataField::isMandatory
bool isMandatory()
returns True if the field's type must have a value
DataProvider::AbstractDataField::getMandatoryType
AbstractDataField getMandatoryType()
Returns a mandatory (i.e. not "or nothing") field equivalent to the current field.
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::attr
hash< auto > attr
User-defined custom attributes set on the field.
Definition AbstractDataField.qc.dox.h:107
DataProvider::AbstractDataField::setDefaultValue
AbstractDataField setDefaultValue(auto default_value)
sets the default value for the field
DataProvider::AbstractDataField::getDescription
abstract *string getDescription()
returns the description, if any
DataProvider::AbstractDataField::setAttributes
AbstractDataField setAttributes(hash< auto > attr)
Sets custom attributes.
DataProvider::AbstractDataField::element_allowed_values_creatable
*bool element_allowed_values_creatable
Do elements of the field for list types accept values not defined in element_allowed_values too?
Definition AbstractDataField.qc.dox.h:94
DataProvider::AbstractDataField::getName
abstract string getName()
returns the name of the field
DataProvider::AbstractDataField::allowed_values
list< hash< AllowedValueInfo > > allowed_values
for enum fields; raw allowed values
Definition AbstractDataField.qc.dox.h:85
DataProvider::AbstractDataField::getDisplayName
static string getDisplayName(string name)
Converts a technical name into a display name.
DataProvider::AbstractDataField::getElementAllowedValuesCreatable
bool getElementAllowedValuesCreatable()
Get the "element allowed values creatable" flag.
DataProvider::AbstractDataField::getOptions
*hash< auto > getOptions()
returns options set on the field's type
DataProvider::AbstractDataField::getElementAllowedValues
*list< hash< AllowedValueInfo > > getElementAllowedValues()
Get element allowed values.
DataProvider::AbstractDataField::setElementAllowedValues
AbstractDataField setElementAllowedValues(list< auto > element_allowed_values, *bool element_allowed_values_creatable)
Sets allowed values for enum types.
DataProvider::AbstractDataField::isList
bool isList()
returns True if this field's type is a list
DataProvider::AbstractDataField::getElementAllowedValueMap
*hash< string, bool > getElementAllowedValueMap()
Get allowed values.
DataProvider::AbstractDataField::replaceAttributes
replaceAttributes(*hash< auto > attr)
Replaces all custom attributes.
DataProvider::AbstractDataField::getExampleValue
auto getExampleValue(*hash< string, bool > emap, *string fname)
Returns any example value for the field, otherwise return example data from the type.
DataProvider::AbstractDataField::getLocalInfo
hash< DataFieldInfo > getLocalInfo()
Returns information about the field without calling AbstractDataProviderType::getInfo() on the type.
DataProvider::AbstractDataField::getDisplayName
string getDisplayName()
Returns the display name of the field.
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:99
DataProvider::AbstractDataField::getShortDescription
static *string getShortDescription(*string desc, *int maxlen)
Converts a long description into a short description.
DataProvider::AbstractDataField::setOptions
AbstractDataField setOptions(hash< auto > options)
sets the given options on the field's type
DataProvider::AbstractDataField::element_allowed_values
*list< hash< AllowedValueInfo > > element_allowed_values
for enum fields; allowed values for elements for list types
Definition AbstractDataField.qc.dox.h:91
DataProvider::AbstractDataField::element_allowed_values_map
hash< string, bool > element_allowed_values_map
for enum fields; allowed values for elements for list types
Definition AbstractDataField.qc.dox.h:104
DataProvider::AbstractDataField::isMultiselect
bool isMultiselect()
Returns True if the type is a list and the allowed values are allowed values of the list's type.
DataProvider::AbstractDataField::setOption
AbstractDataField setOption(string opt, auto value)
sets the given option on the field's type
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::getAttributes
*hash< auto > getAttributes()
Returns custom attributes set on the field.
DataProvider::AbstractDataField::hasType
bool hasType()
returns True if the field's type is not a wildcard type
DataProvider::AbstractDataField::getAllowedValues
*list< hash< AllowedValueInfo > > getAllowedValues()
Get allowed values.
DataProvider::AbstractDataField::getType
abstract AbstractDataProviderType getType()
returns the type of the field
DataProvider::AbstractDataField::getAllowedValueMap
*hash< string, bool > getAllowedValueMap()
Get allowed values.
DataProvider::AbstractDataField::getShortDescription
*string getShortDescription()
Returns the short description, if any.
DataProvider::AbstractDataProviderType
describes a data type
Definition AbstractDataProviderType.qc.dox.h:139
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::allowed_values_creatable
*bool allowed_values_creatable
Does the field accept values not defined in allowed_values too?
Definition AbstractDataField.qc.dox.h:55
DataProvider::DataFieldInfo::example_value
auto example_value
Any example value for the field.
Definition AbstractDataField.qc.dox.h:46
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:43
DataProvider::DataFieldInfo::multiselect
bool multiselect
Are allowed values elements of the list's element type that indicate what values the list can have?
Definition AbstractDataField.qc.dox.h:49
DataProvider::DataFieldInfo::type
hash< DataTypeInfo > type
Type info.
Definition AbstractDataField.qc.dox.h:64
DataProvider::DataFieldInfo::display_name
string display_name
The display name of the field.
Definition AbstractDataField.qc.dox.h:34
DataProvider::DataFieldInfo::element_allowed_values
*list< hash< AllowedValueInfo > > element_allowed_values
for enum fields; allowed values for elements for list types
Definition AbstractDataField.qc.dox.h:58
DataProvider::DataFieldInfo::unique_key
string unique_key
Unique field identifier.
Definition AbstractDataField.qc.dox.h:67
DataProvider::DataFieldInfo::attr
*hash< auto > attr
User-defined attributes set on the field.
Definition AbstractDataField.qc.dox.h:70
DataProvider::DataFieldInfo::desc
*string desc
the description of the field, if available, with markdown formatting
Definition AbstractDataField.qc.dox.h:40
DataProvider::DataFieldInfo::short_desc
*string short_desc
The short description of the field in plain text.
Definition AbstractDataField.qc.dox.h:37
DataProvider::DataFieldInfo::allowed_values
*list< hash< AllowedValueInfo > > allowed_values
for enum fields; allowed values
Definition AbstractDataField.qc.dox.h:52
DataProvider::DataFieldInfo::element_allowed_values_creatable
*bool element_allowed_values_creatable
Do elements of the field for list types accept values not defined in element_allowed_values too?
Definition AbstractDataField.qc.dox.h:61