#include <ObjectBase.h>
Inheritance diagram for acdk::lang::ObjectBase:
API: ACDK
Public Types | |
typedef unsigned short | RefFlagField |
enum | RefFlags { IsStackRef = 0x0001, IsStaticRef = 0x0002, IsUserHeapRef = 0x0004, IsMemLocked = 0x0008, IsWeakRef = 0x0010, IsUnsynchronized = 0x0020, IsExternalRecorded = 0x0040, ObjectHasLocalGc = 0x0080, IsSoftReference = 0x0100, Visited = 0x1000, Marked = 0x2000, FinalizeCalled = 0x4000, NoRefCounting = 0x8000 } |
Some information about memory status. More... | |
Public Member Functions | |
virtual | ~ObjectBase () |
void * | operator new (size_t size) |
the standard operator new | |
void | operator delete (void *ptr) |
standard operator delete | |
void * | operator new[] (size_t size) |
array allocator forwards to ACDK memory manager | |
void | operator delete[] (void *ptr) |
array deallocator forwards to ACDK memory manager | |
void * | operator new (size_t size, void *mem) |
used for other allocators, will handled as stack var! | |
void * | operator new[] (size_t size, void *mem) |
used for other allocators, will handled as stack var! | |
void | operator delete (void *ptr, void *mem) |
used for other allocators, will handled as stack var! | |
void | operator delete[] (void *ptr, void *mem) |
used for other allocators, will handled as stack var! | |
void * | operator new (size_t size,::acdk::lang::sys::Allocator *allocator) |
operator new, which uses the placement operator. | |
void | operator delete (void *mem,::acdk::lang::sys::Allocator *allocator) |
this operator delete will only be called, in the case of an Exception in the of Object or derived | |
inline::acdk::lang::sys::Allocator * | allocator () |
returns the Allocator of this Object. | |
void * | allocate (size_t size, acdk::lang::sys::AllocatedType at=acdk::lang::sys::RawMem) |
If the object was allocated with an Allocator, this allocator can be used to allocate internal memory. | |
void | deallocate (void *ptr, acdk::lang::sys::AllocatedType at=acdk::lang::sys::RawMem) |
If the object was allocated with an Allocator, this allocator can be used to deallocate internal memory. | |
void | releaseRef (bool force=false) const |
release Reference. | |
bool | _releaseRefCount () const |
decrement the Object refcounter and dispose this object | |
virtual bool | _gc_releaseRef (bool force=false) const |
may be called by releaseRef() if ObjectHasLocalGc is set | |
void | addRef (bool force=false) const |
increment reference counter | |
void | disposeRef () const |
releases this object. | |
void | testIntegrity () const |
test if object is still sane | |
unsigned short | magic () const |
return the magic (_MagicObjectSig or _MagicDeletedSig) from this object instance | |
void | _inititializeObjectAttrFlags (int flags) |
internal function to set flags before constructor | |
void | _setObjectRefFlag (bool onoff, RefFlagField flag) const |
set or release internal flag | |
bool | _isObjectRefFlag (RefFlagField theFlag) const |
int | refCount () const |
returns the current reference counter | |
void | setStackRef () const |
set Object as Stack Object. | |
bool | isStackRef () const |
returns true if Object is allocated on Stack | |
void | setStackRef (bool asstackref) const |
declares this object as stack object. | |
bool | isStaticRef () const |
returns true if object is declared as static referenced | |
void | setStaticRef (bool asstaticref) const |
returns set or remove reference as static | |
bool | isWeakRef () const |
returns true if object is declared as weak referenced | |
bool | isMemLocked () const |
returns true if object reference is locked | |
void | lockMem (bool lockit) const |
lock or unlock the object reference. | |
bool | isMarked () const |
used internally for garbage collecting | |
void | setMarked () const |
used internally for garbage collecting | |
void | unsetMarked () const |
used internally for garbage collecting | |
bool | isUnsynchronized () const |
returns true if object is declared as unsychronizable, which means lock/unlock will have no effect | |
void | setUnsynchronized (bool unsynced) const |
returns set or unset unsychronizable, which means lock/unlock will have no effect | |
bool | hasLocalGc () const |
void | setLocalGc (bool flag) const |
bool | isExternalRecorded () const |
returns true if object external listener, which should be notified at deletion | |
void | setExternalRecorded (bool flag) const |
see isExternalRecorded() | |
bool | isSoftReference () const |
return true if this object is held by a soft reference | |
void | setSoftReference (bool flag) const |
see isSoftReference() | |
void | aquireLock () |
aquire MT-Lock from lock cache | |
virtual void | lock () |
lock the object instance. | |
virtual void | unlock () |
unlock the object instance Note: Will be overwritten by acdk::io::Reader and acdk::io::Writer Note: if Unsynchronized or isStack is set, this call will have no effect | |
virtual void | finalize () |
Only for Java compatibility. | |
void | _call_finalize () |
call finalize only if FinalizeCalled not set | |
virtual dmi::ClazzInfo * | getClazzInfo () |
return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc | |
virtual Object * | _cast (const acdk::lang::dmi::ClazzInfo *ci) |
for DMI implemented classes with multiple interface allow casts. | |
virtual void | getCollectableFields (FieldReferences &fields) |
retrun the collectable fields of this object (all Objects fields) will be re-implemented for each class by methods generated by acdkmc If this is manually implemented, the flag ObjectHasLocalGc should be set. | |
Static Public Member Functions | |
dmi::ClazzInfo * | clazzInfo () |
return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc | |
void | _throwException (const char *msg=) |
void | _throwBadCastException (const char *msg=) |
void | _throwNullPointerException (const char *msg=) |
void | _throwNotImplementedYet (const char *msg=) |
void | _throwArrayIndexOutOfBoundsException (size_t idx=0, size_t max=size_t(-1), const char *msg=) |
void | _throwIndexOutOfBoundsException (size_t idx=0, size_t max=size_t(-1), const char *msg=) |
void | _throwObjectInsane (const InterfaceBase *obj, int magicsic) |
Static Public Attributes | |
bool | singleThreaded |
global variable which is true if program is running in single thread mode | |
Protected Member Functions | |
ObjectBase () | |
Private Attributes | |
sys::core_atomicop | _refCount |
The Refernce Conter. | |
RefFlagField | _objectRefFlags |
a set of internal Flags. | |
unsigned short | _magic |
magic Number of Object, for sanity check |
|
|
|
Some information about memory status.
|
|
|
|
|
|
call finalize only if FinalizeCalled not set
|
|
for DMI implemented classes with multiple interface allow casts. The returned Object will be casted to the correct type using dynamic_cast
Reimplemented in acdk::lang::ObjectArrayBaseImpl, and acdk::wx::WxObject. |
|
may be called by releaseRef() if ObjectHasLocalGc is set
Reimplemented in acdk::cfgscript::ScriptObject, and tests::acdk::lang::dmi::BClass. |
|
internal function to set flags before constructor
|
|
|
|
decrement the Object refcounter and dispose this object
|
|
set or release internal flag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
increment reference counter
|
|
If the object was allocated with an Allocator, this allocator can be used to allocate internal memory.
|
|
returns the Allocator of this Object. By default it returns the StandardHeapAllocator Reimplemented in acdk::lang::sys::LocalGcHeap. |
|
aquire MT-Lock from lock cache
|
|
return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc
Reimplemented in BasicArray< T >, ObjectArrayImpl< T >, acdk::lang::System, acdk::lisp::LispObject, acdkx::com::ComObject, acdkx::orb::AcdkObject, acdkx::orb::CorObject, BasicArray< int >, BasicArray< byte >, BasicArray< char >, BasicArray< bool >, BasicArray< ucchar >, ObjectArrayImpl< RString >, ObjectArrayImpl< RBucketType >, ObjectArrayImpl< RLispStackFrame >, ObjectArrayImpl< RFile >, ObjectArrayImpl< RLispVar >, and ObjectArrayImpl< RValueType >. |
|
If the object was allocated with an Allocator, this allocator can be used to deallocate internal memory.
|
|
releases this object. calls finalize and delete this |
|
Only for Java compatibility.
Reimplemented in acdk::cfgscript::ScriptObject, acdk::lang::Class, acdk::lang::Object, acdk::xml::libxmldom::LibXMLDocument, and acdkx::orb::ServerDelegate. |
|
return the ClazzInfo for this class will be re-implemented for each class by methods generated by acdkmc
Reimplemented in acdk::cfgscript::ScriptObject, BasicArray< T >, acdk::lang::ObjectArrayBase, acdk::lang::System, acdk::lisp::LispObject, acdkx::com::ComObject, acdkx::orb::AcdkObject, acdkx::orb::CorObject, BasicArray< int >, BasicArray< byte >, BasicArray< char >, BasicArray< bool >, and BasicArray< ucchar >. |
|
retrun the collectable fields of this object (all Objects fields) will be re-implemented for each class by methods generated by acdkmc If this is manually implemented, the flag ObjectHasLocalGc should be set.
Reimplemented in acdk::cfgscript::ScriptObject, acdk::cfgscript::TokenizedSource, acdk::lang::ObjectArrayBase, acdk::lang::System, acdk::lisp::LispObject, acdkx::com::ComObject, acdkx::orb::AcdkObject, acdkx::orb::CorObject, tests::acdk::lang::dmi::AClass, tests::acdk::lang::dmi::AClass, and tests::acdk::lang::dmi::BClass. |
|
|
|
returns true if object external listener, which should be notified at deletion
|
|
used internally for garbage collecting
|
|
returns true if object reference is locked
|
|
return true if this object is held by a soft reference
|
|
returns true if Object is allocated on Stack
|
|
returns true if object is declared as static referenced
|
|
returns true if object is declared as unsychronizable, which means lock/unlock will have no effect
|
|
returns true if object is declared as weak referenced
|
|
lock the object instance. Note: Will be overwritten by acdk::io::Reader and acdk::io::Writer Note: if Unsynchronized or isStack is set, this call will have no effect Reimplemented in acdk::cfgscript::Props, acdk::io::AbstractCharReader, acdk::io::AbstractCharWriter, acdk::io::AbstractReader, acdk::io::AbstractWriter, acdk::util::SynchronizedCollection, and acdk::util::SynchronizedMap. |
|
lock or unlock the object reference. if object is locked, object will not be destroyed |
|
return the magic (_MagicObjectSig or _MagicDeletedSig) from this object instance
|
|
this operator delete will only be called, in the case of an Exception in the of Object or derived
|
|
used for other allocators, will handled as stack var!
|
|
standard operator delete
|
|
used for other allocators, will handled as stack var!
|
|
array deallocator forwards to ACDK memory manager
|
|
operator new, which uses the placement operator. SharedMemAllocator* myObjectAllocator = new SharedMemAllocator(); RString o = new (myObjectAllocator) acdk::lang::Object(); |
|
used for other allocators, will handled as stack var!
|
|
the standard operator new
|
|
used for other allocators, will handled as stack var!
|
|
array allocator forwards to ACDK memory manager
|
|
returns the current reference counter
|
|
release Reference. If not locked or WeakReference, Object will be destroyed |
|
|
|
|
|
used internally for garbage collecting
|
|
|
|
declares this object as stack object. This will also declare the object as synchronizable or not! |
|
Object will normaly not destroyed. |
|
returns set or remove reference as static
|
|
returns set or unset unsychronizable, which means lock/unlock will have no effect
|
|
test if object is still sane
|
|
unlock the object instance Note: Will be overwritten by acdk::io::Reader and acdk::io::Writer Note: if Unsynchronized or isStack is set, this call will have no effect
Reimplemented in acdk::cfgscript::Props, acdk::io::AbstractCharReader, acdk::io::AbstractCharWriter, acdk::io::AbstractReader, acdk::io::AbstractWriter, acdk::util::SynchronizedCollection, and acdk::util::SynchronizedMap. |
|
used internally for garbage collecting
|
|
magic Number of Object, for sanity check
|
|
a set of internal Flags.
|
|
The Refernce Conter.
|
|
global variable which is true if program is running in single thread mode
|