AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
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.
 
virtual std::string getClassName () const =0
 
int getPriority () const
 Return the shutdown priority of the singleton instance.
 
virtual void shutdown ()=0
 Implement this method to cleanup your Singleton class.
 

Protected Member Functions

virtual ~Singleton ()
 Destructor.
 
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

◆ Priority

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

◆ Singleton()

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.

◆ ~Singleton()

virtual agx::Singleton::~Singleton ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ _shutdown()

void agx::Singleton::_shutdown ( )
protected

◆ getClassName()

virtual std::string agx::Singleton::getClassName ( ) const
pure virtual

◆ getPriority()

int agx::Singleton::getPriority ( ) const

Return the shutdown priority of the singleton instance.

◆ shutdown()


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