26#ifndef ITK_FUTURE_LEGACY_REMOVE
35[[deprecated(
"Preferably use the C++ `[[maybe_unused]]` attribute instead!")]]
inline void
54#ifndef ITK_LEGACY_REMOVE
55 using SingletonData [[deprecated(
"The internal representation of the singleton data is private, and may not "
56 "correspond with SingletonData anymore.")]] =
57 std::map<std::string, std::tuple<
void *, std::function<void(
void *)>, std::function<void()>>>;
66 return static_cast<T *
>(this->GetGlobalInstancePrivate(globalName));
76 this->SetGlobalInstancePrivate(globalName,
GlobalObject{ global, std::move(deleteFunc) });
79#ifndef ITK_FUTURE_LEGACY_REMOVE
81 [[deprecated(
"Prefer calling the SetGlobalInstance(globalName, global, deleteFunc) overload (without the unused func "
83 SetGlobalInstance(
const char * globalName,
85 std::function<
void(
void *)> itkNotUsed(func),
86 std::function<
void()> deleteFunc)
88 this->SetGlobalInstance(globalName, global, std::move(deleteFunc));
108 std::function<void()> DeleteFunc{};
137Singleton(
const char * globalName, std::function<
void()> deleteFunc)
141 if (instance ==
nullptr)
150#ifndef ITK_FUTURE_LEGACY_REMOVE
152[[deprecated(
"Prefer calling the Singleton(globalName, deleteFunc) overload (without the unused func parameter)!")]] T *
153Singleton(
const char * globalName, std::function<
void(
void *)> itkNotUsed(func), std::function<
void()> deleteFunc)
155 return Singleton<T>(globalName, std::move(deleteFunc));
Pixel-wise addition of two images.
static Self * GetInstance()
void SetGlobalInstancePrivate(const char *globalName, GlobalObject globalObject)
static void SetInstance(Self *instance)
void * GetGlobalInstancePrivate(const char *globalName)
T * GetGlobalInstance(const char *globalName)
void SetGlobalInstance(const char *globalName, T *global, std::function< void()> deleteFunc)
std::map< std::string, GlobalObject > m_GlobalObjects
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
T * Singleton(const char *globalName, std::function< void()> deleteFunc)