AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agx::Singleton Class Referenceabstract

Base class for Singletons that should have its shutdown called explicitly before exit of the application. More...

#include <Singleton.h>

+ Inheritance diagram for agx::Singleton:

Public Types

enum  Priority { HIGHEST_PRIORITY = 2147483647, LOWEST_PRIORITY = 10000, DEFAULT_PRIORITY = 1073741824 }
 Specifies the ranges of the priority which can be assigned to a singleton at the time of creation. More...
 

Public Member Functions

 Singleton (int priority=DEFAULT_PRIORITY)
 Default constructor. More...
 
virtual std::string getClassName () const =0
 
int getPriority () const
 Return the shutdown priority of the singleton instance. More...
 
virtual void shutdown ()
 Implement this method to cleanup your Singleton class. More...
 

Protected Member Functions

virtual ~Singleton ()
 Destructor. More...
 
void _shutdown ()
 

Detailed Description

Base class for Singletons that should have its shutdown called explicitly before exit of the application.

Definition at line 30 of file Singleton.h.

Member Enumeration Documentation

Specifies the ranges of the priority which can be assigned to a singleton at the time of creation.

Enumerator
HIGHEST_PRIORITY 

The highest priority that can be given to a singleton.

LOWEST_PRIORITY 

The lowest priority that can be given to a singleton.

DEFAULT_PRIORITY 

The default priority given to a singleton.

Definition at line 35 of file Singleton.h.

Constructor & Destructor Documentation

agx::Singleton::Singleton ( int  priority = DEFAULT_PRIORITY)

Default constructor.

Parameters
priority- The higher priority, the earlier it will get its shutdown executed during application shutdown. So if there is someone which should be shutdown early, use a high priority. Usually default should work.
virtual agx::Singleton::~Singleton ( )
protectedvirtual

Destructor.

Member Function Documentation

void agx::Singleton::_shutdown ( )
protected
virtual std::string agx::Singleton::getClassName ( ) const
pure virtual
int agx::Singleton::getPriority ( ) const

Return the shutdown priority of the singleton instance.


The documentation for this class was generated from the following file: