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;
}
Defines a reference-counted pointer that provides reference counting semantics for types that do not ...
Definition RWTCountingPointer.h:64
static RWTCountingPointer< T, RWAtomicCounter > & instance()
Definition RWTSingleton.h:65