public |
Inheritance Graph
graph BT
Object
Object --> EReferenceCounter
Bool --> Object
Collection --> Object
ExtObject --> Object
ExtReferenceObject --> Object
FnBinder --> Object
Function --> Object
Identifier --> Object
Iterator --> Object
Number --> Object
ReferenceObject --> Object
String --> Object
Type --> Object
YieldIterator --> Object
click Object "classEScript_1_1Object"
click EReferenceCounter "classEScript_1_1EReferenceCounter"
click Bool "classEScript_1_1Bool"
click Collection "classEScript_1_1Collection"
click ExtObject "classEScript_1_1ExtObject"
click ExtReferenceObject "classEScript_1_1ExtReferenceObject"
click FnBinder "classEScript_1_1FnBinder"
click Function "classEScript_1_1Function"
click Identifier "classEScript_1_1Identifier"
click Iterator "classEScript_1_1Iterator"
click Number "classEScript_1_1Number"
click ReferenceObject "classEScript_1_1ReferenceObject"
click String "classEScript_1_1String"
click Type "classEScript_1_1Type"
click YieldIterator "classEScript_1_1YieldIterator"
Description
[ Object ]
Initialization
Type * | getTypeObject() |
void | init( EScript::Namespace & globals) |
Main
Object() Default constructor; Sets the type to Object::getTypeObject() |
|
Object( Type * type) | |
~Object() | |
Object * | getRefOrCopy() Return a clone of the object if the type is call-by-value and the object itthisObj otherwise. |
Object * | clone() const o |
StringId | hash() const o |
bool | rt_isEqual( Runtime & rt, const ObjPtr & other) |
bool | isEqual( Runtime & rt, const ObjPtr & o) Compare two Objects using the ‘==’-member function. |
bool | isIdentical( Runtime & rt, const ObjPtr & other) |
internalTypeId_t | _getInternalTypeId() const |
void | _assignValue( ObjPtr value) |
Type
ERef < Type > | typeRef |
Type * | getType() const |
bool | isA(const Type * type) const o |
Attributes
Attribute * | _accessAttribute(const StringId & id, bool localOnly) |
void | _initAttributes( Runtime & rt) |
const Attribute & | getLocalAttribute(const StringId & id) const |
const Attribute & | getAttribute(const StringId & id) const |
const Attribute & | getAttribute(const char * c_str) const |
bool | setAttribute(const StringId & id, const Attribute & attr) |
bool | setAttribute(const char * c_str, const Attribute & attr) |
void | collectLocalAttributes(std::unordered_map< StringId , Object * > & void) |
Conversion
std::string | toString() const o |
int | toInt() const o |
unsigned int | toUInt() const o |
double | toDouble() const o |
float | toFloat() const o |
bool | toBool() const o |
std::string | toDbgString() const o |
Documentation
function
EScript::Object::getTypeObject
public | static |
Type * getTypeObject( | ) |
Defined in EScript/EScript/Objects/Object.h:37
function
EScript::Object::init
public | static |
void init( | EScript::Namespace & | globals ) |
Defined in EScript/EScript/Objects/Object.h:38
function
EScript::Object::Object
public |
Object( | ) |
Default constructor; Sets the type to Object::getTypeObject()
Defined in EScript/EScript/Objects/Object.h:49
function
EScript::Object::Object
public |
Object( | Type * | type ) |
Defined in EScript/EScript/Objects/Object.h:50
function
EScript::Object::~Object
public | virtual |
~Object( | ) |
Defined in EScript/EScript/Objects/Object.h:51
function
EScript::Object::getRefOrCopy
public |
Object * getRefOrCopy( | ) |
Return a clone of the object if the type is call-by-value and the object itthisObj otherwise.
Defined in EScript/EScript/Objects/Object.h:58
function
EScript::Object::clone
public | const | virtual |
Object * clone( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:61
function
EScript::Object::hash
public | const | virtual |
StringId hash( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:63
function
EScript::Object::rt_isEqual
public | virtual |
bool rt_isEqual( | Runtime & | rt, |
const ObjPtr & | other | |
) |
o
Note: For camparing objects, never use this function directly but use isEqual(…) instead. Otherwise scripted ‘==’-member functions are not supported.
Defined in EScript/EScript/Objects/Object.h:68
function
EScript::Object::isEqual
public |
bool isEqual( | Runtime & | rt, |
const ObjPtr & | o | |
) |
Compare two Objects using the ‘==’-member function.
Defined in EScript/EScript/Objects/Object.h:71
function
EScript::Object::isIdentical
public |
bool isIdentical( | Runtime & | rt, |
const ObjPtr & | other | |
) |
If this is an Object which is passed …
-
call-by-value, this functions returns true if the given object’s Type is the same as this’ type and isEqual returns true.
-
call-by-reference, this function returns true if the given object and this are the same Object .
Defined in EScript/EScript/Objects/Object.h:77
function
EScript::Object::_getInternalTypeId
public | const | inline | virtual |
internalTypeId_t _getInternalTypeId( | ) const |
o For internal use only.
Defined in EScript/EScript/Objects/Object.h:82
function
EScript::Object::_assignValue
public | virtual |
void _assignValue( | ObjPtr | value ) |
If this object is the value of an attribute marked as reference, and a new value is assigned to this attribute, this function is called instead of setting the new object as value for the attribute. This makes only sense for reference objects like NumberRef.
Defined in EScript/EScript/Objects/Object.h:90
variable
EScript::Object::typeRef
protected |
ERef < Type > typeRef |
Defined in EScript/EScript/Objects/Object.h:99
function
EScript::Object::getType
public | const | inline |
Type * getType( | ) const |
Defined in EScript/EScript/Objects/Object.h:101
function
EScript::Object::isA
public | const | virtual |
bool isA( | const Type * | type ) const |
o
Defined in EScript/EScript/Objects/Object.h:104
function
EScript::Object::_accessAttribute
public | virtual |
Attribute * _accessAttribute( | const StringId & | id, |
bool | localOnly | |
) |
o (internal) Get access to an Attribute stored at this Object .
Note: Should not be called directly. Use get(Local) Attribute (…) instead.
Note: Has to be overridden if an Object type should support user defined attributes.
Defined in EScript/EScript/Objects/Object.h:116
function
EScript::Object::_initAttributes
public | virtual |
void _initAttributes( | Runtime & | rt ) |
o (internal) This function is called by the runtime after a new Object has been created in the script using “new”. The execution takes place after the Object itthisObj has been created, but before the first scripted constructor is executed. Extended attribute initializations can be performed here.
Note: Has to be overridden if an Object type should support user defined attributes.
Defined in EScript/EScript/Objects/Object.h:123
function
EScript::Object::getLocalAttribute
public | const |
const Attribute & getLocalAttribute( | const StringId & | id ) const |
Get the locally stored attribute with the given id. If the attribute is not found, the resulting attribute references nullptr.
const Attribute & attr = obj->getLocalAttribute("attrName");
if(attr.isNull()) ...
Defined in EScript/EScript/Objects/Object.h:132
function
EScript::Object::getAttribute
public | const |
const Attribute & getAttribute( | const StringId & | id ) const |
Get the attribute with the given id. The attribute can be stored locally or be accessible by the object’s type. If the attribute is not found, the resulting attribute references nullptr.
const Attribute & attr = obj->getAttribute("doesNotExist");
if(attr.isNull()) ...
Defined in EScript/EScript/Objects/Object.h:141
function
EScript::Object::getAttribute
public | const | inline |
const Attribute & getAttribute( | const char * | c_str ) const |
Defined in EScript/EScript/Objects/Object.h:142
function
EScript::Object::setAttribute
public | virtual |
bool setAttribute( | const StringId & | id, |
const Attribute & | attr | |
) |
o Try to set the value of an object attribute. Returns false if the attribute can not be set.
Note: Has to be overridden if an Object type should support user defined attributes.
Defined in EScript/EScript/Objects/Object.h:148
function
EScript::Object::setAttribute
public | inline |
bool setAttribute( | const char * | c_str, |
const Attribute & | attr | |
) |
Defined in EScript/EScript/Objects/Object.h:149
function
EScript::Object::collectLocalAttributes
public | inline | virtual |
void collectLocalAttributes( | std::unordered_map< StringId , Object * > & | void ) |
o Collect all attributes in a map; used for debugging.
Defined in EScript/EScript/Objects/Object.h:153
function
EScript::Object::toString
public | const | virtual |
std::string toString( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:162
function
EScript::Object::toInt
public | const | virtual |
int toInt( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:164
function
EScript::Object::toUInt
public | const | virtual |
unsigned int toUInt( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:166
function
EScript::Object::toDouble
public | const | virtual |
double toDouble( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:168
function
EScript::Object::toFloat
public | const | virtual |
float toFloat( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:170
function
EScript::Object::toBool
public | const | virtual |
bool toBool( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:172
function
EScript::Object::toDbgString
public | const | virtual |
std::string toDbgString( | ) const |
o
Defined in EScript/EScript/Objects/Object.h:174