SCL
1.0
Standard Control Library : Control, dynamics, physics, and simulation
|
#include <CSingleton.hpp>
Public Member Functions | |
virtual | ~CSingleton () |
Static Public Member Functions | |
static SDataStruct * | getData () |
static bool | resetData () |
Protected Attributes | |
SDataStruct | data_ |
Static Protected Attributes | |
static CSingleton * | singleton_ = 0 |
Private Member Functions | |
CSingleton () | |
CSingleton (const CSingleton &) | |
CSingleton & | operator= (const CSingleton &) |
Use this to create a singleton with any given data type
Works quite well to implement the 'Singleton', a shared data structure that allows different threads in a program to communicate efficiently.
|
virtual |
Default destructor : Deletes the singleton instance if it exists
|
inlineprivate |
Private constructor : for the singleton
|
inlineprivate |
Private constructor : for the singleton
|
static |
Creates a singleton if necessary and returns it.
Returns a pointer instead of a reference to support a 0 return when there is an error
|
inlineprivate |
Private operator : for the singleton
|
static |
Deletes the singleton instance and creates a new one.
|
protected |
Shared Memory: The publicly available data that will be shared across the different subsystems
|
staticprotected |
The singleton instance
This initializes the pointer to null