A templated Multiton class. More...
#include <pmvcpp.h>
Static Public Member Functions | |
static T * | instance () |
Retrieve a default instance of T. | |
static T * | instance (std::string key) |
Retrieve a named instance of T. | |
static bool | exists (std::string key) |
Check existance. | |
static size_t | size () |
Total instances. | |
static void | erase (std::string key) |
Deletes an instance. | |
static void | clear () |
Deletes instances. |
A templated Multiton class.
Multiton takes care of creating multitons of other classes. We use this instead implementing multiton code in Facade, Model, Controller, etc.
static void PureMVC::Multiton< T >::clear | ( | ) | [inline, static] |
Deletes instances.
Deletes all instances, calls destructors.
static void PureMVC::Multiton< T >::erase | ( | std::string | key | ) | [inline, static] |
Deletes an instance.
Deletes one instance of key key
.
static bool PureMVC::Multiton< T >::exists | ( | std::string | key | ) | [inline, static] |
Check existance.
Check whether or not an instance of name key exists.
key | A string key |
static T* PureMVC::Multiton< T >::instance | ( | std::string | key | ) | [inline, static] |
Retrieve a named instance of T.
Create a new named instance of T or return one pointed to by key.
key | A string key |
static T* PureMVC::Multiton< T >::instance | ( | ) | [inline, static] |
Retrieve a default instance of T.
Create a new default instance or return existing.
static size_t PureMVC::Multiton< T >::size | ( | ) | [inline, static] |
Total instances.
The total number of instances instantiated.