Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# Keos::CSingleton< T > Class Template Reference

Template class for creating single-instance global classes. More...

`#include <KeosSingleton.h>`

List of all members.

## Static Public Member Functions

static void | Create ()
| Create instance of the class.
static T & | Instance ()
| Return single-instance of the class.
static void | Destroy ()
| Destroy single-instance of the class.
static void | _SetInstance (T *pInst)
| Change the intance of the class.

## Protected Member Functions

| CSingleton ()
| Default constructor.
| ~CSingleton ()
| Destructor.

## Private Member Functions

| CSingleton (CSingleton &)
| Copy constructor.
void | operator= (CSingleton &)
| Affectation operator.

## Static Private Attributes

static T * | ms_pInst = NULL
| Class instance.

## Detailed Description

### template<class T>
class Keos::CSingleton< T >

Template class for creating single-instance global classes.

Definition at line 34 of file KeosSingleton.h.

## Constructor & Destructor Documentation

template<class T>
Keos::CSingleton< T >::CSingleton | ( |  | ) | `[inline, protected]`

| Default constructor. Definition at line 80 of file KeosSingleton.h.

template<class T>
Keos::CSingleton< T >::~CSingleton | ( |  | ) | `[inline, protected]`

| Destructor. Definition at line 85 of file KeosSingleton.h.

template<class T>
Keos::CSingleton< T >::CSingleton | ( | CSingleton< T > & |  | ) | `[private]`

| Copy constructor.

## Member Function Documentation

template<class T>
static void Keos::CSingleton< T >::_SetInstance | ( | T * | pInst | ) | `[inline, static]`

| Change the intance of the class. Definition at line 70 of file KeosSingleton.h.

template<class T>
static void Keos::CSingleton< T >::Create | ( |  | ) | `[inline, static]`

| Create instance of the class. Definition at line 41 of file KeosSingleton.h.

template<class T>
static void Keos::CSingleton< T >::Destroy | ( | void |  | ) | `[inline, static]`

| Destroy single-instance of the class. Definition at line 61 of file KeosSingleton.h.

template<class T>
static T& Keos::CSingleton< T >::Instance | ( |  | ) | `[inline, static]`

| Return single-instance of the class.

Returns:
  The single-instance.

Definition at line 50 of file KeosSingleton.h.

template<class T>
void Keos::CSingleton< T >::operator= | ( | CSingleton< T > & |  | ) | `[private]`

| Affectation operator.

## Member Data Documentation

template<class T>
T * Keos::CSingleton< T >::ms_pInst = NULL`[static, private]`

| Class instance. Definition at line 104 of file KeosSingleton.h.

The documentation for this class was generated from the following file:

- KeosEngine/KeosSingleton.h