Ensures that a class has only one instance and provides a global point of access to it.
More...
template<class T>
class RWTSingleton< T >
RWTSingleton ensures that a class has only one instance, and provides a global point of access to it. This is an Object Creational pattern. For more information, see Design Patterns by Gamma, Helm, Johnson, and Vlissides.
- Example
#include <rw/pointer/RWTSingleton.h>
#include <iostream>
class Foo
{
public:
void function() {
std::cout << "I'm a foo example" << std::endl;
}
};
int main(void)
{
singleFooPtr->function();
return 0;
}