32#ifndef ETL_SINGLETON_BASE_INCLUDED
33#define ETL_SINGLETON_BASE_INCLUDED
54 singleton_base_exception(string_type reason_, string_type file_name_, numeric_type line_number_)
55 :
exception(reason_, file_name_, line_number_)
67 singleton_base_not_created(string_type file_name_, numeric_type line_number_)
68 : singleton_base_exception(ETL_ERROR_TEXT(
"singleton_base:not created", ETL_SINGLETON_BASE_FILE_ID
"A"), file_name_, line_number_)
80 singleton_base_already_created(string_type file_name_, numeric_type line_number_)
81 : singleton_base_exception(ETL_ERROR_TEXT(
"singleton_base:already created", ETL_SINGLETON_BASE_FILE_ID
"B"), file_name_, line_number_)
116 template <
typename T>
136 return (m_self != ETL_NULLPTR);
149 m_self = &theInstance;
157 m_self = ETL_NULLPTR;
169 T* singleton_base<T>::m_self = ETL_NULLPTR;
Singleton instance already exists.
Definition singleton_base.h:77
Base singleton error exception.
Definition singleton_base.h:51
Singleton not created error exception.
Definition singleton_base.h:64
static bool is_valid()
Returns whether an instance has been attached to singleton<T> or not.
Definition singleton_base.h:134
~singleton_base()
Removes the internal reference to the instance passed in the constructor.
Definition singleton_base.h:155
singleton_base(T &theInstance)
Definition singleton_base.h:145
#define ETL_ASSERT(b, e)
Definition error_handler.h:356
ETL_CONSTEXPR exception(string_type reason_, string_type, numeric_type line_)
Constructor.
Definition exception.h:69
Definition exception.h:47
bitset_ext
Definition absolute.h:39
T * singleton_base< T >::m_self
No violation of one definition rule as this is a class template.
Definition singleton_base.h:169