Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Resource(3I) — Lucid Energize 2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Resource(3I)  —  InterViews Reference Manual

NAME

Resource − InterViews shared object

SYNOPSIS

#include <InterViews/resource.h>

DESCRIPTION

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 global function Unref should be used to unreference the object.  When a resource is unreferenced, the reference count is decremented and if it becomes zero the object is destroyed. 

PUBLIC OPERATIONS

Resource()
Create a new resource object with its reference count set to zero.

void Reference()
Increment the resource’s reference count.

FRIEND OPERATIONS

void Unref(Resource∗)
If the resource pointer is non-nil, decrement its reference count and destroy the object if the reference count is now zero. Unref is a global function, not a Resource member function, because it must check if the target pointer is nil.

InterViews  —  Last change: 11 September 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026