18 #ifndef itkSingleton_h
19 #define itkSingleton_h
50 using SingletonData = std::map<std::string, std::tuple<
void *, std::function<void(
void *)>, std::function<void()>>>;
58 return static_cast<T *>(this->GetGlobalInstancePrivate(globalName));
70 std::function<
void(
void *)> func,
71 std::function<
void()> deleteFunc)
73 return this->SetGlobalInstancePrivate(globalName, global, func, deleteFunc);
81 SetInstance(
Self * instance);
93 GetGlobalInstancePrivate(
const char * globalName);
97 SetGlobalInstancePrivate(
const char * globalName,
99 std::function<
void(
void *)> func,
100 std::function<
void()> deleteFunc);
113 template <
typename T>
115 Singleton(
const char * globalName, std::function<
void(
void *)> func, std::function<
void()> deleteFunc)
120 if (instance ==
nullptr)