class
RCObject
(Return to index)
Abstract base class for reference counted objects.
It collaborates with the templace class Pointer<Object>.
It is modelled after the class RCObject described in:
{center}
Scott Meyers, More Effective C++, Addison Wesley, 1996, pg. 195.
{/center}
The idiom delete this has been avoided by moving the deletion
to class Pointer<Object>.
All derived classes must implement a clone() method, to allow the
Pointer class to copy the object pointed at.
All constructors, the destructor, and the assignment operators are
protected, since a stand-alone RCObject makes no sense.
Type: |
Abstract |
Include file: |
./MemoryManagement/RCObject.hh |
Inheritance
Synopsis (including inherited members):
- Public members:
- Protected Members:
-
RCObject
()
;
-
RCObject
(const RCObject&)
;
-
virtual ~RCObject
()
= 0
;
-
RCObject& operator=
(const RCObject&)
;
Documentation:
- Public members:
-
int addReference
()const
;
- Increment reference count.
Return the new value of the reference count.
-
bool isShared
()const
;
- Test for sharing.
Return true, if the pointee has more than one reference.
-
int removeReference
()const
;
- Decrement the reference count.
Return the new value of the reference count.
- Protected members:
-
RCObject
()
;
- Default constructor.
By default a new object is sharable.
-
RCObject
(const RCObject&)
;
- Copy constructor.
The copy inherits the sharable state.
Documentation generated by fci on Mon Feb 7 11:41:49 2000