C4 Engine
C4 Engine API Documentation

class Holder

Defined in:  TSTools.h
A helper class the wraps a pointer to an object.
Definition

template <class type> class Holder

Template Parameters
type The type of object to which the Holder object refers.
Constructor

explicit Holder(type *ptr);

Parameters
ptr A pointer to the object that is wrapped by the Holder object.
Description
The Holder class template is a helper class that wraps a pointer to an object. When a Holder object is destroyed (usually by going out of scope), the object that was passed into the ptr parameter when the Holder object was constructed is automatically deleted with the delete operator.

A Holder object behaves like a pointer to an object of the type given by the type template parameter. A Holder object can be passed as a function parameter wherever a pointer to type is expected, and the -> operator can be used to access members of the object that the Holder object wraps.
See Also

AutoRelease