#include <QoreObject.h>
Public Member Functions | |
DLLEXPORT | QoreObject (const QoreClass *oc, QoreProgram *p) |
creates an object as belonging to the given class, the QoreProgram object is referenced for the life of the object as well | |
DLLEXPORT | QoreObject (const QoreClass *oc, QoreProgram *p, AbstractPrivateData *data) |
creates an object as belonging to the given class, the QoreProgram object is referenced for the life of the object as well, and the private data is stored with the class ID of the class | |
virtual DLLEXPORT int | getAsString (QoreString &str, int foff, ExceptionSink *xsink) const |
concatenate the verbose string representation of the list (including all contained values) to an existing QoreString | |
virtual DLLEXPORT QoreString * | getAsString (bool &del, int foff, ExceptionSink *xsink) const |
returns a QoreString giving the verbose string representation of the List (including all contained values) | |
virtual DLLEXPORT AbstractQoreNode * | realCopy () const |
performs a deep copy of the list and returns the new list | |
virtual DLLEXPORT bool | is_equal_soft (const AbstractQoreNode *v, ExceptionSink *xsink) const |
tests for equality ("deep compare" including all contained values) with possible type conversion (soft compare) | |
virtual DLLEXPORT bool | is_equal_hard (const AbstractQoreNode *v, ExceptionSink *xsink) const |
tests for equality ("deep compare" including all contained values) without type conversions (hard compare) | |
virtual DLLEXPORT const char * | getTypeName () const |
returns the type name as a c string | |
DLLEXPORT bool | validInstanceOf (qore_classid_t cid) const |
returns true if this object is a valid instance of the classid passed | |
DLLEXPORT void | setValue (const char *key, AbstractQoreNode *val, ExceptionSink *xsink) |
sets the value of the given member to the given value | |
DLLEXPORT QoreListNode * | getMemberList (ExceptionSink *xsink) const |
returns the list of members, caller owns the list returned | |
DLLEXPORT void | deleteMemberValue (const QoreString *key, ExceptionSink *xsink) |
removes a member from the object, if the member's value is an object it is deleted as well (destructor is called) | |
DLLEXPORT void | deleteMemberValue (const char *key, ExceptionSink *xsink) |
removes a member from the object, if the member's value is an object it is deleted as well (destructor is called) | |
DLLEXPORT void | removeMember (const QoreString *key, ExceptionSink *xsink) |
removes a member from the object without explicitly calling destructors; the value is only dereferenced | |
DLLEXPORT void | removeMember (const char *key, ExceptionSink *xsink) |
removes a member from the object without explicitly calling destructors; the value is only dereferenced | |
DLLEXPORT int | size (ExceptionSink *xsink) const |
returns the number of members of the object | |
DLLEXPORT bool | compareSoft (const QoreObject *obj, ExceptionSink *xsink) const |
tests for equality ("deep compare" including all contained values) with possible type conversion of contained elements (soft compare) | |
DLLEXPORT bool | compareHard (const QoreObject *obj, ExceptionSink *xsink) const |
tests for equality ("deep compare" including all contained values) with possible type conversion of contained elements (hard compare) | |
DLLEXPORT AbstractQoreNode * | getReferencedMemberNoMethod (const char *mem, ExceptionSink *xsink) const |
returns the value of the given member with the reference count incremented, the caller owns the AbstractQoreNode (reference) returned | |
DLLEXPORT int64 | getMemberAsBigInt (const char *mem, bool &found, ExceptionSink *xsink) const |
returns the value of the given member as an int64 | |
DLLEXPORT QoreHashNode * | copyData (ExceptionSink *xsink) const |
retuns all member data of the object (or 0 if there's an exception), caller owns the QoreHashNode reference returned | |
DLLEXPORT void | mergeDataToHash (QoreHashNode *hash, ExceptionSink *xsink) |
copies all member data of the current object to the passed QoreHashNode | |
DLLEXPORT void | setPrivate (qore_classid_t key, AbstractPrivateData *pd) |
sets private data for the object against the class ID passed, used in C++ functions implementing Qore constructors | |
DLLEXPORT AbstractPrivateData * | getReferencedPrivateData (qore_classid_t key, ExceptionSink *xsink) const |
returns the private data corresponding to the class ID passed with an incremented reference count, caller owns the reference | |
DLLEXPORT AbstractQoreNode * | evalMethod (const QoreString *name, const QoreListNode *args, ExceptionSink *xsink) |
evaluates the given method with the arguments passed and returns the return value, caller owns the AbstractQoreNode (reference) returned | |
DLLEXPORT AbstractQoreNode * | evalMethod (const char *name, const QoreListNode *args, ExceptionSink *xsink) |
evaluates the given method with the arguments passed and returns the return value, caller owns the AbstractQoreNode (reference) returned | |
DLLEXPORT AbstractQoreNode * | evalMethod (const QoreMethod &method, const QoreListNode *args, ExceptionSink *xsink) |
evaluates the given method with the arguments passed and returns the return value, caller owns the AbstractQoreNode (reference) returned | |
DLLEXPORT void | doDelete (ExceptionSink *xsink) |
runs the destructor on the object (if it hasn't already been deleted) | |
DLLEXPORT const QoreClass * | getClass (qore_classid_t cid) const |
returns a pointer to a QoreClass object if the class ID passed is a valid class in the hierarchy | |
DLLEXPORT const QoreClass * | getClass () const |
returns a pointer to the QoreClass of this object | |
DLLEXPORT const char * | getClassName () const |
returns the name of the class | |
DLLEXPORT bool | isValid () const |
returns true if the object is valid | |
DLLEXPORT QoreProgram * | getProgram () const |
returns the QoreProgram object associated with this object | |
DLLEXPORT bool | isSystemObject () const |
returns true if the object is a system object (created with the system constructor) | |
DLLEXPORT void | tRef () const |
increments the existence reference count | |
DLLEXPORT void | tDeref () |
decrements the existence reference count, when it reaches 0 the C++ object ("this") will be deleted | |
DLLEXPORT AbstractQoreNode * | getMemberValueNoMethod (const QoreString *key, AutoVLock *vl, ExceptionSink *xsink) const |
returns the pointer to the value of the member | |
DLLEXPORT AbstractQoreNode * | getMemberValueNoMethod (const char *key, AutoVLock *vl, ExceptionSink *xsink) const |
returns the pointer to the value of the member | |
DLLEXPORT void | deleteBlockerRef () const |
increment the reference count of the object, to be called only from within a delete blocker | |
DLLEXPORT void | externalDelete (qore_classid_t key, ExceptionSink *xsink) |
call this function when an object's private data is deleted externally | |
DLLLOCAL AbstractQoreNode * | evalMember (const QoreString *member, ExceptionSink *xsink) |
returns the value of the member with an incremented reference count, or executes the memberGate() method and returns the value | |
DLLLOCAL void | merge (const QoreHashNode *h, ExceptionSink *xsink) |
merges data from a hash as members of the object | |
DLLLOCAL QoreHashNode * | getRuntimeMemberHash (ExceptionSink *xsink) const |
retuns member data of the object (or 0 if there's an exception), private members are excluded if called outside the class, caller owns the QoreHashNode reference returned | |
DLLLOCAL AbstractPrivateData * | getAndClearPrivateData (qore_classid_t key, ExceptionSink *xsink) |
retrieves the private data pointer and clears it from the object's private data store, used when executing destructors | |
DLLLOCAL AbstractQoreNode * | evalBuiltinMethodWithPrivateData (const QoreMethod &method, BuiltinMethod *meth, const QoreListNode *args, ExceptionSink *xsink) |
called to evaluate a builtin method when private data is available | |
DLLLOCAL AbstractQoreNode * | evalBuiltinMethodWithPrivateData (BuiltinMethod *meth, const QoreListNode *args, ExceptionSink *xsink) |
called to evaluate a builtin method with the new calling convention when private data is available | |
DLLLOCAL void | evalCopyMethodWithPrivateData (const QoreClass &thisclass, BuiltinMethod *meth, QoreObject *self, bool new_calling_convention, ExceptionSink *xsink) |
called on the old object (this) to acquire private data, copy method called on "self" (new copy) | |
DLLLOCAL void | addPrivateDataToString (QoreString *str, ExceptionSink *xsink) const |
concatenates info about private data to a string | |
DLLLOCAL void | obliterate (ExceptionSink *xsink) |
destroys all members and dereferences all private data structures | |
DLLLOCAL void | defaultSystemDestructor (qore_classid_t classID, ExceptionSink *xsink) |
runs the destructor for system objects | |
DLLLOCAL AbstractQoreNode ** | getMemberValuePtr (const QoreString *key, AutoVLock *vl, ExceptionSink *xsink) const |
returns a pointer to a pointer to the value of the member, so it can be set externally | |
DLLLOCAL AbstractQoreNode ** | getMemberValuePtr (const char *key, AutoVLock *vl, ExceptionSink *xsink) const |
returns a pointer to a pointer to the value of the member, so it can be set or changed externally | |
DLLLOCAL AbstractQoreNode ** | getExistingValuePtr (const QoreString *mem, AutoVLock *vl, ExceptionSink *xsink) const |
returns a pointer to a pointer to the value of the member only if it already exists, so it can be set externally | |
DLLLOCAL AbstractQoreNode ** | getExistingValuePtr (const char *mem, AutoVLock *vl, ExceptionSink *xsink) const |
returns a pointer to a pointer to the value of the member only if it already exists | |
DLLLOCAL | QoreObject (const QoreClass *oc, QoreProgram *p, QoreHashNode *d) |
creates the object with the initial data passed as "d", used by the copy constructor | |
DLLLOCAL bool | evalDeleteBlocker (BuiltinMethod *meth) |
evaluates the delete blocker function for the managed private data | |
DLLLOCAL bool | hasMemberNotification () const |
returns true if the class has a memberNotification method | |
DLLLOCAL void | execMemberNotification (const char *member, ExceptionSink *xsink) |
executes the member notification on the object the given member | |
DLLLOCAL VRMutex * | getClassSyncLock () |
returns the class-synchronous lock (if any) for the object | |
Static Public Member Functions | |
static DLLLOCAL const char * | getStaticTypeName () |
returns the type name as a c string | |
Protected Member Functions | |
virtual DLLEXPORT bool | derefImpl (ExceptionSink *xsink) |
runs the destructor if necessary and dereferences all members | |
virtual DLLLOCAL AbstractQoreNode * | evalImpl (ExceptionSink *xsink) const |
should never be called, does nothing | |
virtual DLLLOCAL AbstractQoreNode * | evalImpl (bool &needs_deref, ExceptionSink *xsink) const |
should never be called, does nothing | |
virtual DLLLOCAL int64 | bigIntEvalImpl (ExceptionSink *xsink) const |
should never be called, does nothing | |
virtual DLLLOCAL int | integerEvalImpl (ExceptionSink *xsink) const |
should never be called, does nothing | |
virtual DLLLOCAL bool | boolEvalImpl (ExceptionSink *xsink) const |
should never be called, does nothing | |
virtual DLLLOCAL double | floatEvalImpl (ExceptionSink *xsink) const |
should never be called, does nothing | |
DLLLOCAL void | customRefIntern () const |
custom reference handler - unlocked | |
virtual DLLLOCAL void | customRef () const |
custom reference handler | |
virtual DLLLOCAL void | customDeref (ExceptionSink *xsink) |
custom dereference handler | |
virtual DLLLOCAL | ~QoreObject () |
destructor |
objects in Qore are unique unless copied explicitly (similar to Java) Builtin classes (those classes implemented in C++ as opposed to user classes implemented in the Qore language) can have "private data", which is data that maintains the state of the object per that class. QoreObject objects store this data as well as any member data.
objects have two levels of reference counts - one is for the existence of the c++ object (tRefs below) the other is for the scope of the object (the parent QoreReferenceCounter) - when this reaches 0 the object will have its destructor run (if it hasn't already been deleted). Only when the tRef counter reaches 0, meaning that no more pointers are pointing to this object will the object actually be deleted.
DLLEXPORT QoreObject::QoreObject | ( | const QoreClass * | oc, | |
QoreProgram * | p | |||
) |
creates an object as belonging to the given class, the QoreProgram object is referenced for the life of the object as well
oc | the class of the object being created | |
p | the QoreProgram object where the object "lives", this QoreProgram object is referenced for the life of the object to ensure that it is not deleted while the object still exists (for example, if the object is exported to a parent QoreProgram object) |
DLLEXPORT QoreObject::QoreObject | ( | const QoreClass * | oc, | |
QoreProgram * | p, | |||
AbstractPrivateData * | data | |||
) |
creates an object as belonging to the given class, the QoreProgram object is referenced for the life of the object as well, and the private data is stored with the class ID of the class
oc | the class of the object being created | |
p | the QoreProgram object where the object "lives", this QoreProgram object is referenced for the life of the object to ensure that it is not deleted while the object still exists (for example, if the object is exported to a parent QoreProgram object) | |
data | the private data corresponding to the class ID of the class passed |
virtual DLLEXPORT bool QoreObject::derefImpl | ( | ExceptionSink * | xsink | ) | [protected, virtual] |
runs the destructor if necessary and dereferences all members
Note that other objects could be deleted as well if they are members of this object, any exceptions thrown there will also be added to "xsink"
xsink | if an error occurs, the Qore-language exception information will be added here |
Reimplemented from AbstractQoreNode.
virtual DLLLOCAL AbstractQoreNode* QoreObject::evalImpl | ( | ExceptionSink * | xsink | ) | const [protected, virtual] |
should never be called, does nothing
in debugging builds calls to this function will abort
Implements AbstractQoreNode.
virtual DLLLOCAL AbstractQoreNode* QoreObject::evalImpl | ( | bool & | needs_deref, | |
ExceptionSink * | xsink | |||
) | const [protected, virtual] |
should never be called, does nothing
in debugging builds calls to this function will abort
Implements AbstractQoreNode.
virtual DLLLOCAL int64 QoreObject::bigIntEvalImpl | ( | ExceptionSink * | xsink | ) | const [protected, virtual] |
should never be called, does nothing
in debugging builds calls to this function will abort
Implements AbstractQoreNode.
virtual DLLLOCAL int QoreObject::integerEvalImpl | ( | ExceptionSink * | xsink | ) | const [protected, virtual] |
should never be called, does nothing
in debugging builds calls to this function will abort
Implements AbstractQoreNode.
virtual DLLLOCAL bool QoreObject::boolEvalImpl | ( | ExceptionSink * | xsink | ) | const [protected, virtual] |
should never be called, does nothing
in debugging builds calls to this function will abort
Implements AbstractQoreNode.
virtual DLLLOCAL double QoreObject::floatEvalImpl | ( | ExceptionSink * | xsink | ) | const [protected, virtual] |
should never be called, does nothing
in debugging builds calls to this function will abort
Implements AbstractQoreNode.
virtual DLLEXPORT int QoreObject::getAsString | ( | QoreString & | str, | |
int | foff, | |||
ExceptionSink * | xsink | |||
) | const [virtual] |
concatenate the verbose string representation of the list (including all contained values) to an existing QoreString
used for n and N printf formatting
str | the string representation of the type will be concatenated to this QoreString reference | |
foff | for multi-line formatting offset, -1 = no line breaks | |
xsink | if an error occurs, the Qore-language exception information will be added here |
Implements AbstractQoreNode.
virtual DLLEXPORT QoreString* QoreObject::getAsString | ( | bool & | del, | |
int | foff, | |||
ExceptionSink * | xsink | |||
) | const [virtual] |
returns a QoreString giving the verbose string representation of the List (including all contained values)
used for n and N printf formatting
del | if this is true when the function returns, then the returned QoreString pointer should be deleted, if false, then it must not be | |
foff | for multi-line formatting offset, -1 = no line breaks | |
xsink | if an error occurs, the Qore-language exception information will be added here NOTE: Use the QoreNodeAsStringHelper class (defined in QoreStringNode.h) instead of using this function directly |
Implements AbstractQoreNode.
virtual DLLEXPORT bool QoreObject::is_equal_soft | ( | const AbstractQoreNode * | v, | |
ExceptionSink * | xsink | |||
) | const [virtual] |
tests for equality ("deep compare" including all contained values) with possible type conversion (soft compare)
v | the value to compare | |
xsink | if an error occurs, the Qore-language exception information will be added here |
Implements AbstractQoreNode.
virtual DLLEXPORT bool QoreObject::is_equal_hard | ( | const AbstractQoreNode * | v, | |
ExceptionSink * | xsink | |||
) | const [virtual] |
tests for equality ("deep compare" including all contained values) without type conversions (hard compare)
v | the value to compare | |
xsink | if an error occurs, the Qore-language exception information will be added here |
Implements AbstractQoreNode.
DLLEXPORT bool QoreObject::validInstanceOf | ( | qore_classid_t | cid | ) | const |
returns true if this object is a valid instance of the classid passed
cid | the class ID to check |
DLLEXPORT void QoreObject::setValue | ( | const char * | key, | |
AbstractQoreNode * | val, | |||
ExceptionSink * | xsink | |||
) |
sets the value of the given member to the given value
the value must be already referenced for the assignment to the object
key | the name of the member | |
val | the value to set for the member (must be already referenced for the assignment, 0 is OK too) | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT QoreListNode* QoreObject::getMemberList | ( | ExceptionSink * | xsink | ) | const |
returns the list of members, caller owns the list returned
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::deleteMemberValue | ( | const QoreString * | key, | |
ExceptionSink * | xsink | |||
) |
removes a member from the object, if the member's value is an object it is deleted as well (destructor is called)
key | the name of the member to delete | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::deleteMemberValue | ( | const char * | key, | |
ExceptionSink * | xsink | |||
) |
removes a member from the object, if the member's value is an object it is deleted as well (destructor is called)
key | the name of the member to delete, assumed to be in the default encoding (QCS_DEFAULT) | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::removeMember | ( | const QoreString * | key, | |
ExceptionSink * | xsink | |||
) |
removes a member from the object without explicitly calling destructors; the value is only dereferenced
objects will be destructed if they go out of scope, however
key | the name of the member to remove | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::removeMember | ( | const char * | key, | |
ExceptionSink * | xsink | |||
) |
removes a member from the object without explicitly calling destructors; the value is only dereferenced
objects will be destructed if they go out of scope, however
key | the name of the member to remove, assumed to be in the default encoding (QCS_DEFAULT) | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT int QoreObject::size | ( | ExceptionSink * | xsink | ) | const |
returns the number of members of the object
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT bool QoreObject::compareSoft | ( | const QoreObject * | obj, | |
ExceptionSink * | xsink | |||
) | const |
tests for equality ("deep compare" including all contained values) with possible type conversion of contained elements (soft compare)
obj | the object to compare | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT bool QoreObject::compareHard | ( | const QoreObject * | obj, | |
ExceptionSink * | xsink | |||
) | const |
tests for equality ("deep compare" including all contained values) with possible type conversion of contained elements (hard compare)
obj | the object to compare | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT AbstractQoreNode* QoreObject::getReferencedMemberNoMethod | ( | const char * | mem, | |
ExceptionSink * | xsink | |||
) | const |
returns the value of the given member with the reference count incremented, the caller owns the AbstractQoreNode (reference) returned
mem | the name member to retrieve the value for | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT int64 QoreObject::getMemberAsBigInt | ( | const char * | mem, | |
bool & | found, | |||
ExceptionSink * | xsink | |||
) | const |
returns the value of the given member as an int64
mem | the name member to retrieve the value for | |
found | returns true if the member was found, false if not | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT QoreHashNode* QoreObject::copyData | ( | ExceptionSink * | xsink | ) | const |
retuns all member data of the object (or 0 if there's an exception), caller owns the QoreHashNode reference returned
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::mergeDataToHash | ( | QoreHashNode * | hash, | |
ExceptionSink * | xsink | |||
) |
copies all member data of the current object to the passed QoreHashNode
hash | the hash to copy all data from | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::setPrivate | ( | qore_classid_t | key, | |
AbstractPrivateData * | pd | |||
) |
sets private data for the object against the class ID passed, used in C++ functions implementing Qore constructors
key | the class ID of the class to set the private data for | |
pd | the private data for the given class ID |
DLLEXPORT AbstractPrivateData* QoreObject::getReferencedPrivateData | ( | qore_classid_t | key, | |
ExceptionSink * | xsink | |||
) | const |
returns the private data corresponding to the class ID passed with an incremented reference count, caller owns the reference
key | the class ID of the class to get the private data for | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT AbstractQoreNode* QoreObject::evalMethod | ( | const QoreString * | name, | |
const QoreListNode * | args, | |||
ExceptionSink * | xsink | |||
) |
evaluates the given method with the arguments passed and returns the return value, caller owns the AbstractQoreNode (reference) returned
name | the name of the method to evaluate | |
args | the arguments for the method (may be 0) | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT AbstractQoreNode* QoreObject::evalMethod | ( | const char * | name, | |
const QoreListNode * | args, | |||
ExceptionSink * | xsink | |||
) |
evaluates the given method with the arguments passed and returns the return value, caller owns the AbstractQoreNode (reference) returned
name | the name of the method to evaluate, must be in QCS_DEFAULT encoding | |
args | the arguments for the method (may be 0) | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT AbstractQoreNode* QoreObject::evalMethod | ( | const QoreMethod & | method, | |
const QoreListNode * | args, | |||
ExceptionSink * | xsink | |||
) |
evaluates the given method with the arguments passed and returns the return value, caller owns the AbstractQoreNode (reference) returned
method | the method to evaluate | |
args | the arguments for the method (may be 0) | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::doDelete | ( | ExceptionSink * | xsink | ) |
runs the destructor on the object (if it hasn't already been deleted)
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT const QoreClass* QoreObject::getClass | ( | qore_classid_t | cid | ) | const |
DLLEXPORT const QoreClass* QoreObject::getClass | ( | ) | const |
DLLEXPORT const char* QoreObject::getClassName | ( | ) | const |
returns the name of the class
DLLEXPORT bool QoreObject::isValid | ( | ) | const |
returns true if the object is valid
DLLEXPORT QoreProgram* QoreObject::getProgram | ( | ) | const |
returns the QoreProgram object associated with this object
for system objects only (created with the system constructor) this will be 0
DLLEXPORT bool QoreObject::isSystemObject | ( | ) | const |
returns true if the object is a system object (created with the system constructor)
DLLEXPORT void QoreObject::tRef | ( | ) | const |
increments the existence reference count
Will not prolong the scope of the object (use QoreObject::ref() to prolong the scope of the object). To derecrement the count, call QoreObject::tDeref()
DLLEXPORT void QoreObject::tDeref | ( | ) |
decrements the existence reference count, when it reaches 0 the C++ object ("this") will be deleted
To increment the existence reference count, call QoreObject::tRef()
DLLEXPORT AbstractQoreNode* QoreObject::getMemberValueNoMethod | ( | const QoreString * | key, | |
AutoVLock * | vl, | |||
ExceptionSink * | xsink | |||
) | const |
returns the pointer to the value of the member
if the member exists, the lock is held and added to the AutoVLock "vl", otherwise the lock is released an exception will be thrown if the character encoding conversion fails also if the object has a deleted status an exception will be thrown NOTE: the value returned is not referenced by this function, but rather the object is locked
key | the name of the member | |
vl | the AutoVLock container for nested locking | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT AbstractQoreNode* QoreObject::getMemberValueNoMethod | ( | const char * | key, | |
AutoVLock * | vl, | |||
ExceptionSink * | xsink | |||
) | const |
returns the pointer to the value of the member
NOTE: the value returned is not referenced by this function, but rather the object is locked
key | the name of the member, assumed to be in the default encoding (QCS_DEFAULT) | |
vl | the AutoVLock container for nested locking | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLEXPORT void QoreObject::deleteBlockerRef | ( | ) | const |
increment the reference count of the object, to be called only from within a delete blocker
it is an error to call this function from anything other than a delete blocker
DLLEXPORT void QoreObject::externalDelete | ( | qore_classid_t | key, | |
ExceptionSink * | xsink | |||
) |
call this function when an object's private data is deleted externally
this function will clear the private data and delete the object
key | the class ID of the class that owns the private data | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractQoreNode* QoreObject::evalMember | ( | const QoreString * | member, | |
ExceptionSink * | xsink | |||
) |
returns the value of the member with an incremented reference count, or executes the memberGate() method and returns the value
member | the name of the member to get the value for (or evaluate the memberGate() method against) | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL void QoreObject::merge | ( | const QoreHashNode * | h, | |
ExceptionSink * | xsink | |||
) |
merges data from a hash as members of the object
h | the hash to merge | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL QoreHashNode* QoreObject::getRuntimeMemberHash | ( | ExceptionSink * | xsink | ) | const |
retuns member data of the object (or 0 if there's an exception), private members are excluded if called outside the class, caller owns the QoreHashNode reference returned
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractPrivateData* QoreObject::getAndClearPrivateData | ( | qore_classid_t | key, | |
ExceptionSink * | xsink | |||
) |
retrieves the private data pointer and clears it from the object's private data store, used when executing destructors
key | the class key to use | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractQoreNode* QoreObject::evalBuiltinMethodWithPrivateData | ( | const QoreMethod & | method, | |
BuiltinMethod * | meth, | |||
const QoreListNode * | args, | |||
ExceptionSink * | xsink | |||
) |
called to evaluate a builtin method when private data is available
method | a constant reference to the QoreMethod object | |
meth | the name of the method to evalute | |
args | the arguments for the method | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractQoreNode* QoreObject::evalBuiltinMethodWithPrivateData | ( | BuiltinMethod * | meth, | |
const QoreListNode * | args, | |||
ExceptionSink * | xsink | |||
) |
called to evaluate a builtin method with the new calling convention when private data is available
meth | the name of the method to evalute | |
args | the arguments for the method | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL void QoreObject::addPrivateDataToString | ( | QoreString * | str, | |
ExceptionSink * | xsink | |||
) | const |
concatenates info about private data to a string
str | the string to concatenate to | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL void QoreObject::obliterate | ( | ExceptionSink * | xsink | ) |
destroys all members and dereferences all private data structures
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL void QoreObject::defaultSystemDestructor | ( | qore_classid_t | classID, | |
ExceptionSink * | xsink | |||
) |
runs the destructor for system objects
classID | the ID of the class | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractQoreNode** QoreObject::getMemberValuePtr | ( | const QoreString * | key, | |
AutoVLock * | vl, | |||
ExceptionSink * | xsink | |||
) | const |
returns a pointer to a pointer to the value of the member, so it can be set externally
if no exception occurs, the lock is held and added to the AutoVLock "vl", otherwise the lock is released an exception will be thrown if the character encoding conversion fails also if the object has a deleted status an exception will be thrown
key | the name of the member | |
vl | the AutoVLock container for nested locking | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractQoreNode** QoreObject::getMemberValuePtr | ( | const char * | key, | |
AutoVLock * | vl, | |||
ExceptionSink * | xsink | |||
) | const |
returns a pointer to a pointer to the value of the member, so it can be set or changed externally
if no exception occurs, the lock is held and added to the AutoVLock "vl", otherwise the lock is released if the object has a deleted status an exception will be thrown
key | the name of the member, assumed to be in the default encoding (QCS_DEFAULT) | |
vl | the AutoVLock container for nested locking | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractQoreNode** QoreObject::getExistingValuePtr | ( | const QoreString * | mem, | |
AutoVLock * | vl, | |||
ExceptionSink * | xsink | |||
) | const |
returns a pointer to a pointer to the value of the member only if it already exists, so it can be set externally
if no exception occurs, the lock is held and added to the AutoVLock "vl", otherwise the lock is released an exception will be thrown if the character encoding conversion fails also if the object has a deleted status an exception will be thrown
mem | the name of the member | |
vl | the AutoVLock container for nested locking | |
xsink | if an error occurs, the Qore-language exception information will be added here |
DLLLOCAL AbstractQoreNode** QoreObject::getExistingValuePtr | ( | const char * | mem, | |
AutoVLock * | vl, | |||
ExceptionSink * | xsink | |||
) | const |
returns a pointer to a pointer to the value of the member only if it already exists
if no exception occurs, the lock is held and added to the AutoVLock "vl", otherwise the lock is released if the object has a deleted status an exception will be thrown
mem | the name of the member, assumed to be in the default encoding (QCS_DEFAULT) | |
vl | the AutoVLock container for nested locking | |
xsink | if an error occurs, the Qore-language exception information will be added here |