95#ifndef G4TLSSINGLETON_HH
96#define G4TLSSINGLETON_HH 1
124 using fvector_t = std::vector<std::function<void()>>;
129 static fvector_t& GetCallbacks();
135 template <
typename FuncT>
136 static typename fvector_t::iterator
Insert(FuncT&& _func)
139 return GetCallbacks().emplace(GetCallbacks().end(),
140 std::forward<FuncT>(_func));
147 friend void G4AutoDelete::Register<T>(T*);
169 mutable std::list<T*> instances;
213 if(instance ==
static_cast<T*
>(0))
226 instances.push_back(i);
232 if(instances.empty())
235 while(!instances.empty())
237 T* thisinst = instances.front();
238 instances.pop_front();
#define G4MUTEXDESTROY(mutex)
#define G4MUTEXINIT(mutex)
void Put(const value_type &val) const
static fvector_t::iterator Insert(FuncT &&_func)
~G4ThreadLocalSingleton() override
G4ThreadLocalSingleton & operator=(G4ThreadLocalSingleton &&)=default
G4ThreadLocalSingleton(G4ThreadLocalSingleton &&)=default
G4ThreadLocalSingleton(const G4ThreadLocalSingleton &)=delete
friend void G4AutoDelete::Register(T *)
G4ThreadLocalSingleton & operator=(const G4ThreadLocalSingleton &)=delete