public |
Inheritance Graph
graph BT
EPtr
click EPtr "classEScript_1_1EPtr"
Description
Weak smart pointer for referencing Objects (without implicit handling of the reference counter!) with some safe conversion functions (toString etc.).
Information
_T * | get() const Returns a pointer to the referenced Object . |
_T * | operator->() const Direct access to the referenced Object . |
bool | isNull() const Returns true if the referenced object is nullptr. |
bool | isNotNull() const Returns true if the referenced object is not nullptr. |
operator bool() const | |
bool | operator==(const EPtr & other) const |
bool | operator==(const _T * o2) const |
bool | operator!=(const EPtr & other) const |
bool | operator!=(const _T * o2) const |
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
EPtr() | |
EPtr(_T * _obj) | |
EPtr(const ERef < _T > & other) |
Documentation
function
EScript::EPtr::get
public | const | inline |
_T * get( | ) const |
Returns a pointer to the referenced Object .
Defined in EScript/EScript/Utils/ObjRef.h:242
function
EScript::EPtr::operator->
public | const | inline |
_T * operator->( | ) const |
Direct access to the referenced Object .
Defined in EScript/EScript/Utils/ObjRef.h:245
function
EScript::EPtr::isNull
public | const | inline |
bool isNull( | ) const |
Returns true if the referenced object is nullptr.
Defined in EScript/EScript/Utils/ObjRef.h:248
function
EScript::EPtr::isNotNull
public | const | inline |
bool isNotNull( | ) const |
Returns true if the referenced object is not nullptr.
Defined in EScript/EScript/Utils/ObjRef.h:251
function
EScript::EPtr::operator bool
public | const | inline | explicit |
operator bool( | ) const |
Defined in EScript/EScript/Utils/ObjRef.h:253
function
EScript::EPtr::operator==
public | const | inline |
bool operator==( | const EPtr & | other ) const |
Defined in EScript/EScript/Utils/ObjRef.h:255
function
EScript::EPtr::operator==
public | const | inline |
bool operator==( | const _T * | o2 ) const |
Defined in EScript/EScript/Utils/ObjRef.h:256
function
EScript::EPtr::operator!=
public | const | inline |
bool operator!=( | const EPtr & | other ) const |
Defined in EScript/EScript/Utils/ObjRef.h:257
function
EScript::EPtr::operator!=
public | const | inline |
bool operator!=( | const _T * | o2 ) const |
Defined in EScript/EScript/Utils/ObjRef.h:258
function
EScript::EPtr::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:265
function
EScript::EPtr::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:270
function
EScript::EPtr::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:273
function
EScript::EPtr::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:276
function
EScript::EPtr::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:279
function
EScript::EPtr::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:282
function
EScript::EPtr::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:285
function
EScript::EPtr::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:288
function
EScript::EPtr::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:291
function
EScript::EPtr::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:294
function
EScript::EPtr::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:297
function
EScript::EPtr::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:300
function
EScript::EPtr::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:303
function
EScript::EPtr::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:306
function
EScript::EPtr::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:309
function
EScript::EPtr::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:314
function
EScript::EPtr::castTo
public | const | inline |
template< class _T2 > | |
_T2 * castTo( | ) const |
Defined in EScript/EScript/Utils/ObjRef.h:315
function
EScript::EPtr::EPtr
public | inline |
EPtr( | ) |
Defined in EScript/EScript/Utils/ObjRef.h:235
function
EScript::EPtr::EPtr
public | inline |
EPtr( | _T * | _obj ) |
Defined in EScript/EScript/Utils/ObjRef.h:236
function
EScript::EPtr::EPtr
public | inline |
EPtr( | const ERef < _T > & | other ) |
Defined in EScript/EScript/Utils/ObjRef.h:237