| public |
Inheritance Graph
graph BT
ERef
ERef --> _CountedRef
click ERef "classEScript_1_1ERef"
click _CountedRef "classEScript_1_1__CountedRef"
Description
| Smart pointer for referencing Objects (with implicit handling of the reference counter) with some safe conversion functions (toString etc.). ERef | > _CountedRef |
Conversion
| template< typename target_t > | |
| target_t | to( Runtime & runtime) Returns a value of the type target_t if possible or throws an exception. |
| template< typename target_t > | |
| target_t | to( Runtime & runtime, const target_t & defaultValue) |
| bool | toBool() const Returns object-> toBool() if the referenced object is not nullptr, false otherwise. |
| bool | toBool(bool defaultValue) const Returns object-> toBool() if the referenced object is not nullptr, defaultValue otherwise. |
| std::string | toDbgString() const Returns object-> toDbgString() if the referenced object is not nullptr, “[nullptr]” otherwise. |
| double | toDouble() const Returns object-> toDouble() if the referenced object is not nullptr, 0.0 otherwise. |
| double | toDouble(double defaultValue) const Returns object-> toDouble() if the referenced object is not nullptr, defaultValue otherwise. |
| float | toFloat() const Returns object-> toFloat() if the referenced object is not nullptr, 0.0f otherwise. |
| float | toFloat(float defaultValue) const Returns object-> toFloat() if the referenced object is not nullptr, defaultValue otherwise. |
| int | toInt() const Returns object-> toInt() if the referenced object is not nullptr, 0 otherwise. |
| int | toInt(int defaultValue) const Returns object-> toInt() if the referenced object is not nullptr, defaultValue otherwise. |
| unsigned int | toUInt() const Return object-> toUInt() if the referenced object is not nullptr, 0 otherwise. |
| unsigned int | toUInt(unsigned int defaultValue) const Return object-> toUInt() if the referenced object is not nullptr, defaultValue otherwise. |
| std::string | toString() const Returns object-> toString() if the referenced object is not nullptr, “” otherwise. |
| std::string | toString(const std::string & defaultValue) const Returns object-> toString() if the referenced object is not nullptr, defaultValue otherwise. |
| template< class _T2 > | |
| _T2 * | toType() const Tries to convert object to given Type ; returns nullptr if object is nullptr or not of given type. |
| template< class _T2 > | |
| _T2 * | castTo() const |
Public Functions
| ERef() | |
| ERef(_T * _obj) | |
| ERef(const EPtr < _T > & other) |
Documentation
function
EScript::ERef::to
| public | inline |
| template< typename target_t > | ||
| target_t to( | Runtime & | runtime ) |
Returns a value of the type target_t if possible or throws an exception.
Defined in EScript/EScript/Utils/ObjRef.h:176
function
EScript::ERef::to
| public | inline |
| template< typename target_t > | ||
| target_t to( | Runtime & | runtime, |
| const target_t & | defaultValue | |
| ) |
If the reference is null, the default value is returend; otherwise a value of the type target_t is returned if possible or an exception is thrown.
Defined in EScript/EScript/Utils/ObjRef.h:181
function
EScript::ERef::toBool
| public | const | inline |
| bool toBool( | ) const |
Returns object-> toBool() if the referenced object is not nullptr, false otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:184
function
EScript::ERef::toBool
| public | const | inline |
| bool toBool( | bool | defaultValue ) const |
Returns object-> toBool() if the referenced object is not nullptr, defaultValue otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:187
function
EScript::ERef::toDbgString
| public | const | inline |
| std::string toDbgString( | ) const |
Returns object-> toDbgString() if the referenced object is not nullptr, “[nullptr]” otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:190
function
EScript::ERef::toDouble
| public | const | inline |
| double toDouble( | ) const |
Returns object-> toDouble() if the referenced object is not nullptr, 0.0 otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:193
function
EScript::ERef::toDouble
| public | const | inline |
| double toDouble( | double | defaultValue ) const |
Returns object-> toDouble() if the referenced object is not nullptr, defaultValue otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:196
function
EScript::ERef::toFloat
| public | const | inline |
| float toFloat( | ) const |
Returns object-> toFloat() if the referenced object is not nullptr, 0.0f otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:199
function
EScript::ERef::toFloat
| public | const | inline |
| float toFloat( | float | defaultValue ) const |
Returns object-> toFloat() if the referenced object is not nullptr, defaultValue otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:202
function
EScript::ERef::toInt
| public | const | inline |
| int toInt( | ) const |
Returns object-> toInt() if the referenced object is not nullptr, 0 otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:205
function
EScript::ERef::toInt
| public | const | inline |
| int toInt( | int | defaultValue ) const |
Returns object-> toInt() if the referenced object is not nullptr, defaultValue otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:208
function
EScript::ERef::toUInt
| public | const | inline |
| unsigned int toUInt( | ) const |
Return object-> toUInt() if the referenced object is not nullptr, 0 otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:211
function
EScript::ERef::toUInt
| public | const | inline |
| unsigned int toUInt( | unsigned int | defaultValue ) const |
Return object-> toUInt() if the referenced object is not nullptr, defaultValue otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:214
function
EScript::ERef::toString
| public | const | inline |
| std::string toString( | ) const |
Returns object-> toString() if the referenced object is not nullptr, “” otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:217
function
EScript::ERef::toString
| public | const | inline |
| std::string toString( | const std::string & | defaultValue ) const |
Returns object-> toString() if the referenced object is not nullptr, defaultValue otherwise.
Defined in EScript/EScript/Utils/ObjRef.h:220
function
EScript::ERef::toType
| public | const | inline |
| template< class _T2 > | |
| _T2 * toType( | ) const |
Tries to convert object to given Type ; returns nullptr if object is nullptr or not of given type.
Defined in EScript/EScript/Utils/ObjRef.h:225
function
EScript::ERef::castTo
| public | const | inline |
| template< class _T2 > | |
| _T2 * castTo( | ) const |
Defined in EScript/EScript/Utils/ObjRef.h:226
function
EScript::ERef::ERef
| public | inline |
| ERef( | ) |
Defined in EScript/EScript/Utils/ObjRef.h:168
function
EScript::ERef::ERef
| public | inline |
| ERef( | _T * | _obj ) |
Defined in EScript/EScript/Utils/ObjRef.h:169
function
EScript::ERef::ERef
| public | inline |
| ERef( | const EPtr < _T > & | other ) |
Defined in EScript/EScript/Utils/ObjRef.h:170