Resource(3I) | Resource(3I) |
Resource - shared object
#include <InterViews/resource.h>
Resource is a class that provides a simple form of reference counting for shared objects. Every resource has a reference count that is initially set to zero and must be explicitly incremented through a call to Reference. A resource should not be deleted like other objects; instead, the static member function unref should be used to unreference the object.
When a resource is unreferenced, the reference count is decremented unless it is already zero. If the count is zero, the object is destroyed.
This scheme relies on manual referencing, which is more efficient, but also more dangerous.
When garbage collection is supported by the runtime system, resources will be unnecessary.
InterViews Reference Manual |