C4 Engine Terathon Software C4 Engine API Documentation

• Utility Library

API Links
Developer Links

class Shared

Defined in:  C4Shared.h
Objects inherit from the Shared class when they contain shared data and need to be reference counted.
Definition

class Shared

Member Functions
Shared::GetReferenceCount Returns an object's current reference count.
Shared::Retain Increments an object's reference count.
Shared::Release Decrements an object's reference count.
Constructor

Shared();

The constructor has protected access and takes no parameters. The Shared class can only exist as a base class for another class.
Description
The Shared class encapsulates a reference count for objects that can be shared. Upon construction, the object's reference count is initialized to 1.
IMPORTANT. The destructor of the Shared class does not have public access, and the destructors of any subclasses of the Shared class should not have public access. Shared objects must be released by calling the Shared::Release function.
See Also

AutoRelease