Qore reflection Module
1.7.0
|
The abstract base class for Qore data types. More...
Inherits Serializable.
Public Member Methods | |
auto | acceptsValue (auto value) |
Returns the value after any conversions by the type. More... | |
bool | canConvertToScalar () |
Returns True if values of this type can be converted to a scalar value. More... | |
constructor (string typestr) | |
Creates the type from the given string. More... | |
hash< string, bool > | getAcceptTypeHash () |
Returns a hash of types accepted by this type. More... | |
Type | getBaseType () |
Returns the base type for the current type; if the type is already a base type (i.e. not an "or nothing" type), then the same type is returned. More... | |
int | getBaseTypeCode () |
Returns the base type code for the type or Qore::NT_ALL for those that don't have types. More... | |
auto | getDefaultValue () |
Returns the default value for the type or nothing if the type has no default value. More... | |
*Type | getElementType () |
Returns the element type for complex list and hash types, if any, otherwise returns nothing. More... | |
string | getName () |
returns the type's name More... | |
Type | getOrNothingType () |
Returns the "or nothing" type for the current type; if the type is already an "or nothing" type (i.e. it already accepts nothing), then the same type is returned. More... | |
hash< string, bool > | getReturnTypeHash () |
Returns a hash of types returned by this type. More... | |
*TypedHash | getTypedHash () |
Returns the TypedHash for the type, if the type specifies a typed hash. More... | |
bool | hasDefaultValue () |
Returns True if this type has a default value. More... | |
bool | hasType () |
Returns True if the type is not a wildcard type; i.e. has type restrictions. More... | |
bool | isAssignableFrom (Type type, reference< bool > may_not_match) |
Returns True if the output of the Type object passed as an argument is compatible with the input type if the current Type. More... | |
bool | isAssignableFrom (Type type) |
Returns True if the output of the Type object passed as an argument is compatible with the input type if the current Type. More... | |
int | isAssignableFrom (auto value) |
Returns True if the Type object can be assigned from the value given as an argument. More... | |
bool | isCompatible (Type type) |
Returns True if the argument type is compatible with the current type (inputs and outputs) More... | |
bool | isEqual (Type type) |
Returns True if the Type object passed as an argument is equal to the current object; False if not. More... | |
bool | isOrNothingType () |
Returns True if the type accepts and returns nothing in addition to other values. More... | |
bool | isOutputCompatible (Type type) |
Returns True if the output of the Type object passed as an argument is compatible with the return type if the current Type. More... | |
bool | isTypedHash () |
Returns True if the type is a TypedHash type, False if not. More... | |
Static Public Member Methods | |
static Type | getOrNothingType (auto v) |
Returns the "or nothing" type object for the value. More... | |
static Type | getType (auto v) |
Returns the type object for the value. More... | |
The abstract base class for Qore data types.
This class cannot be instantiated directly and also cannot be directly inherited by user-defined classes.
auto Qore::Reflection::Type::acceptsValue | ( | auto | value | ) |
Returns the value after any conversions by the type.
value | the value to assign to the type |
RUNTIME-TYPE-ERROR | if the value cannot be assigned to the type |
bool Qore::Reflection::Type::canConvertToScalar | ( | ) |
Qore::Reflection::Type::constructor | ( | string | typestr | ) |
Creates the type from the given string.
string | the type string |
UNKNOWN-TYPE | cannot find the given type |
hash<string,bool> Qore::Reflection::Type::getAcceptTypeHash | ( | ) |
Returns a hash of types accepted by this type.
Type Qore::Reflection::Type::getBaseType | ( | ) |
Returns the base type for the current type; if the type is already a base type (i.e. not an "or nothing" type), then the same type is returned.
int Qore::Reflection::Type::getBaseTypeCode | ( | ) |
Returns the base type code for the type or Qore::NT_ALL for those that don't have types.
auto Qore::Reflection::Type::getDefaultValue | ( | ) |
Returns the default value for the type or nothing if the type has no default value.
*Type Qore::Reflection::Type::getElementType | ( | ) |
Returns the element type for complex list and hash types, if any, otherwise returns nothing.
string Qore::Reflection::Type::getName | ( | ) |
returns the type's name
Type Qore::Reflection::Type::getOrNothingType | ( | ) |
Returns the "or nothing" type for the current type; if the type is already an "or nothing" type (i.e. it already accepts nothing), then the same type is returned.
|
static |
Returns the "or nothing" type object for the value.
hash<string,bool> Qore::Reflection::Type::getReturnTypeHash | ( | ) |
Returns a hash of types returned by this type.
|
static |
Returns the type object for the value.
v | the value to return the type object for |
*TypedHash Qore::Reflection::Type::getTypedHash | ( | ) |
bool Qore::Reflection::Type::hasDefaultValue | ( | ) |
Returns True if this type has a default value.
bool Qore::Reflection::Type::hasType | ( | ) |
Returns True if the type is not a wildcard type; i.e. has type restrictions.
int Qore::Reflection::Type::isAssignableFrom | ( | auto | value | ) |
Returns True if the Type object can be assigned from the value given as an argument.
value | the value to check |
bool Qore::Reflection::Type::isAssignableFrom | ( | Type | type | ) |
Returns True if the output of the Type object passed as an argument is compatible with the input type if the current Type.
type | the type to check output value compatibility with the current type |
bool Qore::Reflection::Type::isAssignableFrom | ( | Type | type, |
reference< bool > | may_not_match | ||
) |
Returns True if the output of the Type object passed as an argument is compatible with the input type if the current Type.
type | the type to check output value compatibility with the current type |
may_not_match | an output variable, if True then the assignment is not guaranteed to succeed and may fail at runtime |
bool Qore::Reflection::Type::isCompatible | ( | Type | type | ) |
Returns True if the argument type is compatible with the current type (inputs and outputs)
type | the type to check compatibility with the current type |
bool Qore::Reflection::Type::isEqual | ( | Type | type | ) |
Returns True if the Type object passed as an argument is equal to the current object; False if not.
type | the type to check with the current type for equality |
bool Qore::Reflection::Type::isOrNothingType | ( | ) |
Returns True if the type accepts and returns nothing in addition to other values.
bool Qore::Reflection::Type::isOutputCompatible | ( | Type | type | ) |
Returns True if the output of the Type object passed as an argument is compatible with the return type if the current Type.
type | the type to check output value compatibility with the current type |
bool Qore::Reflection::Type::isTypedHash | ( | ) |