Qore DataProvider Module Reference  1.0
QoreDataType.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 
38 
39 public:
40 protected:
42  Type type;
43 
45  bool soft_type;
46 
49 
51 
56  hash<string, bool> base_type_hash;
57 
59  *hash<string, bool> accept_type_hash;
60 
62  *hash<string, bool> return_type_hash;
63 
65  hash<string, bool> blacklist_type_hash;
66 
68  const SupportedOptions = {
69  "qore.no_null": <DataProviderTypeOptionInfo>{
70  "type": Type::Boolean,
71  "desc": "if True then NULL is not supported on input if NOTHING is also not accepted",
72  },
73  };
74 
76  const SoftTypeMap = {
77  "int": SoftIntType,
78  "bool": SoftBoolType,
79  "float": SoftFloatType,
80  "number": SoftNumberType,
81  "string": SoftStringType,
82  "date": SoftDateType,
83  "list": SoftAutoListType,
84  "*int": SoftIntOrNothingType,
85  "*bool": SoftBoolOrNothingType,
86  "*float": SoftFloatOrNothingType,
87  "*number": SoftNumberOrNothingType,
88  "*string": SoftStringOrNothingType,
89  "*date": SoftDateOrNothingType,
90  "*list": SoftAutoListOrNothingType,
91  };
92 
93 public:
94 
96  constructor(Type type, *hash<auto> options);
97 
98 
100  string getName();
101 
102 
104  *hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
105 
106 
108  *Type getValueType();
109 
110 
112  *hash<string, bool> getDirectTypeHash();
113 
114 
117 
118 
120 
126  auto acceptsValue(auto value);
127 
128 
130  *hash<string, AbstractDataField> getFields();
131 
132 
134  hash<string, bool> getAcceptTypeHash();
135 
136 
138  hash<string, bool> getReturnTypeHash();
139 
140 
142  hash<DataTypeInfo> getInfo();
143 
144 
148 
149 };
150 };
const SoftTypeMap
map from normal types to soft types
Definition: QoreDataType.qc.dox.h:76
Type type
the Qore type
Definition: QoreDataType.qc.dox.h:42
*AbstractDataProviderType getElementType()
returns the subtype (for lists or hashes) if there is only one
*Type getValueType()
returns the base type for the type, if any
AbstractDataProviderType getSoftType()
string getName()
returns the type name
*hash< string, bool > return_type_hash
hash of base types returned by this type; keys are type names
Definition: QoreDataType.qc.dox.h:62
describes type options
Definition: AbstractDataProviderType.qc.dox.h:122
hash< string, bool > blacklist_type_hash
hash of type codes accepted by the base type but not accepted by this type: code -> True
Definition: QoreDataType.qc.dox.h:65
const Boolean
bool soft_type
flag for soft types
Definition: QoreDataType.qc.dox.h:45
auto acceptsValue(auto value)
returns the value if the value can be assigned to the type
*hash< string, bool > getDirectTypeHash()
returns a hash of native base type code where no translations are performed; keys are type codes,...
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
returns supported options
hash< auto > options
type options
Definition: AbstractDataProviderType.qc.dox.h:169
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:161
hash< string, bool > getAcceptTypeHash()
returns a hash of base types accepted by this type; keys are type names
const SupportedOptions
supported options
Definition: QoreDataType.qc.dox.h:68
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:32
hash< string, bool > base_type_hash
hash of base types where no translations are performed; keys are type codes, not names
Definition: QoreDataType.qc.dox.h:56
describes a data type based on a Qore data type
Definition: QoreDataType.qc.dox.h:37
*hash< string, AbstractDataField > getFields()
returns the fields of the data structure; if any
hash< DataTypeInfo > getInfo()
returns a description of the type as a hash
bool or_nothing_type
flag for "or nothing" types
Definition: QoreDataType.qc.dox.h:48
hash< string, bool > getReturnTypeHash()
returns a hash of base types returned by this type; keys are type names
*hash< string, bool > accept_type_hash
hash of base types accepted by this type; keys are type names
Definition: QoreDataType.qc.dox.h:59