PureMVC::Multiton< T > Class Template Reference

A templated Multiton class. More...

#include <pmvcpp.h>

List of all members.

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.

Detailed Description

template<class T>
class PureMVC::Multiton< T >

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.


Member Function Documentation

template<class T >
static void PureMVC::Multiton< T >::clear (  )  [inline, static]

Deletes instances.

Deletes all instances, calls destructors.

template<class T >
static void PureMVC::Multiton< T >::erase ( std::string  key  )  [inline, static]

Deletes an instance.

Deletes one instance of key key.

template<class T >
static bool PureMVC::Multiton< T >::exists ( std::string  key  )  [inline, static]

Check existance.

Check whether or not an instance of name key exists.

Parameters:
key A string key
template<class T >
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.

Parameters:
key A string key
template<class T >
static T* PureMVC::Multiton< T >::instance (  )  [inline, static]

Retrieve a default instance of T.

Create a new default instance or return existing.

See also:
instance(std::string key)
template<class T >
static size_t PureMVC::Multiton< T >::size (  )  [inline, static]

Total instances.

The total number of instances instantiated.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables

Generated on Wed Feb 17 17:11:23 2010 for PureMVC++ by  doxygen 1.6.1