Easy Navigation
Loading...
Searching...
No Matches
Singleton.hpp File Reference
#include <memory>
#include <mutex>
#include <utility>
Include dependency graph for Singleton.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Singleton< C >
 

Namespaces

namespace  easynav
 

Macros

#define SINGLETON_DEFINITIONS(ClassName)
 

Variables

template<class C>
std::once_flag Singleton< C >::init_flag_
 
template<class C>
std::unique_ptr< C > Singleton< C >::instance_ = nullptr
 

Macro Definition Documentation

◆ SINGLETON_DEFINITIONS

#define SINGLETON_DEFINITIONS ( ClassName)
Value:
public: \
static ClassName * getInstance() \
{ \
return ::easynav::Singleton<ClassName>::getInstance(); \
} \
template<typename ... Args> \
static ClassName * getInstance(Args && ... args) \
{ \
return ::easynav::Singleton<ClassName>::getInstance( \
std::forward<Args>(args)...); \
}