Resource(3X) manual page
Table of Contents
Resource - shared data object
#include <ivplus/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 and defer is true, the object is destroyed.
Resource is an abstract
base class.
Resource
Creates a new
Resource object with its reference count set to zero. Since Resource is
an abstract base class, this constructor is protected.
This operation is called by the unref_deferred() or unref()
operations to tell the resource that it is pending destruction and should
take appropriate actions.
When set to true,
this postpones the deletion of a Resource with a reference count of 0
until flush() is called. If set to false, Resources with a reference count
of 0 will be deleted immediately.
Performs the deletion
on any resources that have been deferred.
Increment the resource’s reference count.
Increments the resource’s reference count. If r is
nil, the ref() operation performs a no-op.
Decrement the resource’s reference count. If the
reference count is zero, call the delete() operation.
Decrements the resource’s reference count. If r is nil, the ref() operation
performs a no-op. If the reference count is zero, call the delete() operation.
Use
in conjunction with the defer() operation to defer deleting resources until
the flush() operation is called.
None.
No example for
this abstract base class.
resource.h
Subject(3X)
.
Table of Contents