Memory management system.
These classes provide a thread safe reference counting mechanism used
in most of the classes in RAVL. Note: to keep the implementation
simple and efficient we don't do any kind of garbage collection, so if
you create a loop of references the objects in question will NOT be
destroyed automatically. The two common ways of getting around this
problem are to either use a container class like GraphC which can cope
with loops of references or to make a parent class for the structure
which manages the destruction of the object ensuring all the loops
are broken when they are no longer needed.
For an example of how to write a simple reference counted class see
exRefCounter.cc. If
you want to create a class hierarchy with inheritance,
exRefCounterInherit.cc shows
how.
For more information on how to use reference counted classes see Ravl.Introduction.Reference
Counting
Normal classes:
RCHandleC | Base class for handles to reference counter objects |
RCBodyC | Base class for all reference counted objects |
RCAbstractC | Abstract handle class for any object derived from RCBodyVC. |
RCHandleVC | Handle from objects derived from RCBodyVC. |
RCBodyVC | Base class for all reference counted objects, where derivation is expected. |
Normal functions:
operator <<(ostream &,const RCHandleC &) | |
operator >>(istream &,RCHandleC &) | Base class for all reference counted objects |
operator >>(istream &,RCBodyC &) | Input body. |
operator <<(ostream &,const RCBodyC &) | Output body. |
operator >>(istream &,RCHandleVC &) | |
operator >>(BinIStreamC &,RCHandleVC &) | Base class for all reference counted objects, where derivation is expected. |
operator >>(istream &,RCBodyVC &) | Input virtual body. |
VCLoad(istream &) | Load object from a stream via a virtual constructor |
VCLoad(BinIStreamC &) | Load object from a binary stream via a virtual constructor |
VCLoad(istream &,BodyT *) | |
VCLoad(BinIStreamC &,BodyT *) | |
operator <<(ostream &,const RCHandleVC &) | Write a handle to a stream. |
operator <<(BinOStreamC &,const RCHandleVC &) | Write binary handle to a stream. |
Advanced classes:
Advanced functions:
Develop classes:
|