#include <HandleId.h>
Inheritance diagram for HandleId::

Public Methods | |
| HandleId () | |
| virtual | ~HandleId () |
| bool | isReferenced () const |
| int | getNoRefs () const |
| bool | dynamicObj () const |
| void | increment () |
| void | decrement () |
| void | traceMe (const char *name_of_variable) |
| void* | operator new (size_t t) |
| void | operator delete (void *v) |
Static Public Methods | |
| int | howManyHandles () |
Protected Attributes | |
| int | refcount |
| char | dynamic_object |
Static Protected Attributes | |
| int | name_counter |
NAME: HandleId - data used by Handle to track pointers to an object
DESCRIPTION:
The class provides the data structure for reference counting (and debugging of reference counting) when using handles. The class to be handled must be derived from "HandleId" (using "public" "virtual" declaration).
|
|
There is a constructor without arguments. No initialization beyond that is necessary. NOTE: The size of class "HandleId" objects depend on preprocessor ("cpp") variables! Check the class definition carefully. When using BasicTools/Diffpack makefiles, no inconsistencies should occur unless one defines "SAFETY_CHECKS" for an application while compiling in optimized mode (this will lead to an error since the application sees a larger "HandleId" object than what is used in the optimized libraries, recall that "SAFETY_CHECKS" is undefined in optimized libraries). |
|
|
|
|
|
decreases the reference counter by one reference. |
|
|
returns true if the object was created by a call to "new" rather than being declared as an instance (e.g., "X x;"). This function is important: Handles should only delete objects that were created by an explicit call to "new". C++ will automatically delete objects that go out of scope the normal way. |
|
|
returns the number of references. |
|
|
returns the total number of handles created so far in an execution. |
|
|
increases the reference counter by one reference. |
|
|
returns true if there are pointers pointing to the present object. Here present object means the object of the subclass derived from "HandleId", that is, the object to be handled by a handle. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|