C4 Engine Terathon Software C4 Engine API Documentation

• System Utilities

API Links
Developer Links

class Singleton

Defined in:  C4Base.h
The Singleton class template is the base class for types having only one global instance.
Definition

template <class type> class Singleton

Template Parameters
type The type of the class having only one global instance.
Constructor

Singleton(type *& instance);

The constructor has protected access. The Singleton class can only exist as a base class for the class of the type given by the type template parameter.
Parameters
instance A reference to the global variable that serves as the pointer to the single instance of the object whose type is given by the type template parameter.
Description
The Singleton class template is used to store a pointer to the single global instance of a class type that should only have one instance.