Loading...
Searching...
No Matches
AbstractDataField.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
namespace DataProvider {
public struct DataFieldInfo {
string name;
string display_name;
*string short_desc;
*string desc;
auto default_value;
auto example_value;
bool multiselect;
*list<hash<AllowedValueInfo>> allowed_values;
*bool allowed_values_creatable;
*list<hash<AllowedValueInfo>> element_allowed_values;
*bool element_allowed_values_creatable;
hash<DataTypeInfo> type;
string unique_key;
*hash<auto> attr;
};
class AbstractDataField : public Qore::Serializable {
public:
protected:
auto default_value;
bool multiselect;
list<hash<AllowedValueInfo>> allowed_values;
*bool allowed_values_creatable;
*list<hash<AllowedValueInfo>> element_allowed_values;
*bool element_allowed_values_creatable;
hash<string, bool> allowed_values_map;
hash<string, bool> element_allowed_values_map;
hash<auto> attr;
public:
bool isAssignableFrom(AbstractDataProviderType t);
bool isAssignableFrom(Type t);
bool isList();
bool isMandatory();
bool isMultiselect();
auto getOptionValue(string opt);
*hash<auto> getOptions();
*hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
AbstractDataField setOption(string opt, auto value);
AbstractDataField setOptions(hash<auto> options);
string getTypeName();
AbstractDataField setAllowedValues(list<auto> allowed_values, *bool allowed_values_creatable);
AbstractDataField setElementAllowedValues(list<auto> element_allowed_values, *bool element_allowed_values_creatable);
AbstractDataField setDefaultValue(auto default_value);
auto getDefaultValue();
*list<hash<AllowedValueInfo>> getAllowedValues();
*hash<string, bool> getAllowedValueMap();
bool getAllowedValuesCreatable();
*list<hash<AllowedValueInfo>> getElementAllowedValues();
*hash<string, bool> getElementAllowedValueMap();
bool getElementAllowedValuesCreatable();
bool hasType();
auto acceptsValue(auto value);
hash<DataFieldInfo> getInputInfo();
hash<DataFieldInfo> getInfo();
hash<DataFieldInfo> getLocalInfo();
hash<DataFieldInfo> getConfigInfo();
AbstractDataField getSoftType();
AbstractDataField getOrNothingType();
AbstractDataField getMandatoryType();
string getDisplayName();
*string getShortDescription();
*hash<auto> getAttributes();
AbstractDataField setAttributes(hash<auto> attr);
replaceAttributes(*hash<auto> attr);
auto getExampleValue(*hash<string, bool> emap, *string fname);
static *string getShortDescription(*string desc, *int maxlen);
static string getDisplayName(string name);
static string getNameFromDisplayName(string display_name);
abstract string getName();
abstract *string getDescription();
abstract AbstractDataProviderType getType();
};
};
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
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