|
|
|
|
|
|
Modules Namespace List Class Hierarchy Alphabetical List Compound List Namespace Members Compound Members Related Pages
acdk::lang::ObjectBase Class Reference#include <ObjectBase.h>
Inheritance diagram for acdk::lang::ObjectBase:
List of all members.
Detailed Description
ACDK specific implementation of Objects.
API: ACDK
- Author:
- Roger Rene Kommer
- Version:
- Revision
- 1.37
- Date:
- Date
- 2005/04/28 14:58:40
|
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
|
Member Typedef Documentation
Member Enumeration Documentation
|
Some information about memory status.
- Enumeration values:
-
IsStackRef |
the object is allocated on the stack |
IsStaticRef |
Reference is allocated as static variable. |
IsUserHeapRef |
Object is allocated on user Heap. |
IsMemLocked |
Similar to IsWeakRef, but can also be unlocked. |
IsWeakRef |
Object will not be deleted if _refCount == 0. |
IsUnsynchronized |
Object will not be synchronized.
This means lock() and unlock will have no effect |
IsExternalRecorded |
Object has external records. |
ObjectHasLocalGc |
in case of releaseRef call objects internal _gc_releaseRef() In case of running System::gc GC doesn't use metainfo to retrieve number of references, but call getCollectableFields() |
IsSoftReference |
Object is Soft-Reference. |
Visited |
Internal, used in GC. |
Marked |
Internal, used in GC. |
FinalizeCalled |
True if finalize is already called. |
NoRefCounting |
Allocator doesn't rely on RefCounting. |
|
Constructor & Destructor Documentation
acdk::lang::ObjectBase::ObjectBase |
( |
|
) |
[protected] |
|
virtual acdk::lang::ObjectBase::~ObjectBase |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
void acdk::lang::ObjectBase::_call_finalize |
( |
|
) |
[inline] |
|
|
call finalize only if FinalizeCalled not set
|
virtual bool acdk::lang::ObjectBase::_gc_releaseRef |
( |
bool |
force = false |
) |
const [inline, virtual] |
|
void acdk::lang::ObjectBase::_inititializeObjectAttrFlags |
( |
int |
flags |
) |
[inline] |
|
|
internal function to set flags before constructor
|
bool acdk::lang::ObjectBase::_isObjectRefFlag |
( |
RefFlagField |
theFlag |
) |
const [inline] |
|
bool acdk::lang::ObjectBase::_releaseRefCount |
( |
|
) |
const [inline] |
|
|
decrement the Object refcounter and dispose this object
|
void acdk::lang::ObjectBase::_setObjectRefFlag |
( |
bool |
onoff, |
|
|
RefFlagField |
flag |
|
) |
const [inline] |
|
|
set or release internal flag
|
void acdk::lang::ObjectBase::_throwArrayIndexOutOfBoundsException |
( |
size_t |
idx = 0, |
|
|
size_t |
max = size_t(-1), |
|
|
const char * |
msg = |
|
) |
[static] |
|
void acdk::lang::ObjectBase::_throwBadCastException |
( |
const char * |
msg = |
) |
[static] |
|
void acdk::lang::ObjectBase::_throwException |
( |
const char * |
msg = |
) |
[static] |
|
void acdk::lang::ObjectBase::_throwIndexOutOfBoundsException |
( |
size_t |
idx = 0, |
|
|
size_t |
max = size_t(-1), |
|
|
const char * |
msg = |
|
) |
[static] |
|
void acdk::lang::ObjectBase::_throwNotImplementedYet |
( |
const char * |
msg = |
) |
[static] |
|
void acdk::lang::ObjectBase::_throwNullPointerException |
( |
const char * |
msg = |
) |
[static] |
|
void acdk::lang::ObjectBase::_throwObjectInsane |
( |
const InterfaceBase * |
obj, |
|
|
int |
magicsic |
|
) |
[static] |
|
void acdk::lang::ObjectBase::addRef |
( |
bool |
force = false |
) |
const [inline] |
|
|
increment reference counter
|
|
If the object was allocated with an Allocator, this allocator can be used to allocate internal memory.
|
void acdk::lang::ObjectBase::aquireLock |
( |
|
) |
|
|
|
aquire MT-Lock from lock cache
|
dmi::ClazzInfo* acdk::lang::ObjectBase::clazzInfo |
( |
|
) |
[inline, static] |
|
|
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.
|
void acdk::lang::ObjectBase::disposeRef |
( |
|
) |
const |
|
|
releases this object.
calls finalize and delete this |
virtual void acdk::lang::ObjectBase::finalize |
( |
|
) |
[inline, virtual] |
|
virtual dmi::ClazzInfo* acdk::lang::ObjectBase::getClazzInfo |
( |
|
) |
[inline, virtual] |
|
|
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 >. |
virtual void acdk::lang::ObjectBase::getCollectableFields |
( |
FieldReferences & |
fields |
) |
[inline, virtual] |
|
|
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. |
bool acdk::lang::ObjectBase::hasLocalGc |
( |
|
) |
const [inline] |
|
bool acdk::lang::ObjectBase::isExternalRecorded |
( |
|
) |
const [inline] |
|
|
returns true if object external listener, which should be notified at deletion
|
bool acdk::lang::ObjectBase::isMarked |
( |
|
) |
const [inline] |
|
|
used internally for garbage collecting
|
bool acdk::lang::ObjectBase::isMemLocked |
( |
|
) |
const [inline] |
|
|
returns true if object reference is locked
|
bool acdk::lang::ObjectBase::isSoftReference |
( |
|
) |
const [inline] |
|
|
return true if this object is held by a soft reference
|
bool acdk::lang::ObjectBase::isStackRef |
( |
|
) |
const [inline] |
|
bool acdk::lang::ObjectBase::isStaticRef |
( |
|
) |
const [inline] |
|
|
returns true if object is declared as static referenced
|
bool acdk::lang::ObjectBase::isUnsynchronized |
( |
|
) |
const [inline] |
|
|
returns true if object is declared as unsychronizable, which means lock/unlock will have no effect
|
bool acdk::lang::ObjectBase::isWeakRef |
( |
|
) |
const [inline] |
|
|
returns true if object is declared as weak referenced
|
virtual void acdk::lang::ObjectBase::lock |
( |
|
) |
[virtual] |
|
void acdk::lang::ObjectBase::lockMem |
( |
bool |
lockit |
) |
const [inline] |
|
|
lock or unlock the object reference.
if object is locked, object will not be destroyed |
unsigned short acdk::lang::ObjectBase::magic |
( |
|
) |
const [inline] |
|
|
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
|
void acdk::lang::ObjectBase::operator delete |
( |
void * |
ptr, |
|
|
void * |
mem |
|
) |
[inline] |
|
|
used for other allocators, will handled as stack var!
|
void acdk::lang::ObjectBase::operator delete |
( |
void * |
ptr |
) |
|
|
void acdk::lang::ObjectBase::operator delete[] |
( |
void * |
ptr, |
|
|
void * |
mem |
|
) |
[inline] |
|
|
used for other allocators, will handled as stack var!
|
void acdk::lang::ObjectBase::operator delete[] |
( |
void * |
ptr |
) |
|
|
|
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(); |
void* acdk::lang::ObjectBase::operator new |
( |
size_t |
size, |
|
|
void * |
mem |
|
) |
[inline] |
|
|
used for other allocators, will handled as stack var!
|
void* acdk::lang::ObjectBase::operator new |
( |
size_t |
size |
) |
|
|
|
the standard operator new
|
void* acdk::lang::ObjectBase::operator new[] |
( |
size_t |
size, |
|
|
void * |
mem |
|
) |
[inline] |
|
|
used for other allocators, will handled as stack var!
|
void* acdk::lang::ObjectBase::operator new[] |
( |
size_t |
size |
) |
|
|
|
array allocator forwards to ACDK memory manager
|
int acdk::lang::ObjectBase::refCount |
( |
|
) |
const [inline] |
|
|
returns the current reference counter
|
void acdk::lang::ObjectBase::releaseRef |
( |
bool |
force = false |
) |
const [inline] |
|
void acdk::lang::ObjectBase::setExternalRecorded |
( |
bool |
flag |
) |
const [inline] |
|
void acdk::lang::ObjectBase::setLocalGc |
( |
bool |
flag |
) |
const [inline] |
|
void acdk::lang::ObjectBase::setMarked |
( |
|
) |
const [inline] |
|
|
used internally for garbage collecting
|
void acdk::lang::ObjectBase::setSoftReference |
( |
bool |
flag |
) |
const [inline] |
|
void acdk::lang::ObjectBase::setStackRef |
( |
bool |
asstackref |
) |
const [inline] |
|
|
declares this object as stack object.
This will also declare the object as synchronizable or not! |
void acdk::lang::ObjectBase::setStackRef |
( |
|
) |
const [inline] |
|
void acdk::lang::ObjectBase::setStaticRef |
( |
bool |
asstaticref |
) |
const [inline] |
|
|
returns set or remove reference as static
|
void acdk::lang::ObjectBase::setUnsynchronized |
( |
bool |
unsynced |
) |
const [inline] |
|
|
returns set or unset unsychronizable, which means lock/unlock will have no effect
|
void acdk::lang::ObjectBase::testIntegrity |
( |
|
) |
const [inline] |
|
|
test if object is still sane
|
virtual void acdk::lang::ObjectBase::unlock |
( |
|
) |
[virtual] |
|
void acdk::lang::ObjectBase::unsetMarked |
( |
|
) |
const [inline] |
|
|
used internally for garbage collecting
|
Member Data Documentation
|
a set of internal Flags.
- See also:
- RefFlags
|
|
global variable which is true if program is running in single thread mode
|
|
|