QNLP  v1.0
QNLP::Singleton Class Reference

Follows the Meyers singleton pattern, allowing thread-safe access to singleton object. More...

#include <Singleton.hpp>

Collaboration diagram for QNLP::Singleton:
Collaboration graph

Public Member Functions

 Singleton (const Singleton &)=delete
 Construct a new Singleton object (disabled) More...
 
 Singleton (Singleton &&)=delete
 Construct a new Singleton object (disabled) More...
 
Singletonoperator= (const Singleton &)=delete
 Overloaded = (disabled) More...
 
Singletonoperator= (Singleton &&)=delete
 Overloaded = (disabled) More...
 

Static Public Member Functions

static SingletongetInstance ()
 Get the Instance object. More...
 

Private Member Functions

 Singleton ()=default
 Construct a new Singleton object. More...
 
virtual ~Singleton ()=default
 Destroy the Singleton object. More...
 

Detailed Description

Follows the Meyers singleton pattern, allowing thread-safe access to singleton object.

Definition at line 15 of file Singleton.hpp.

Constructor & Destructor Documentation

◆ Singleton() [1/3]

QNLP::Singleton::Singleton ( )
privatedefault

Construct a new Singleton object.

◆ ~Singleton()

virtual QNLP::Singleton::~Singleton ( )
privatevirtualdefault

Destroy the Singleton object.

◆ Singleton() [2/3]

QNLP::Singleton::Singleton ( const Singleton )
delete

Construct a new Singleton object (disabled)

◆ Singleton() [3/3]

QNLP::Singleton::Singleton ( Singleton &&  )
delete

Construct a new Singleton object (disabled)

Member Function Documentation

◆ getInstance()

static Singleton& QNLP::Singleton::getInstance ( )
inlinestatic

Get the Instance object.

Returns
Singleton& Returns instance of Singleton object.

Definition at line 63 of file Singleton.hpp.

63  {
64  static Singleton s;
65  return s;
66  }
Singleton()=default
Construct a new Singleton object.

◆ operator=() [1/2]

Singleton& QNLP::Singleton::operator= ( const Singleton )
delete

Overloaded = (disabled)

Returns
Singleton& Reference to singleton object

◆ operator=() [2/2]

Singleton& QNLP::Singleton::operator= ( Singleton &&  )
delete

Overloaded = (disabled)

Returns
Singleton& Reference to singleton object

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