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));
169 mutable std::list<T*> instances;
226 instances.push_back(i);
230void G4ThreadLocalSingleton<T>::Clear()
232 if(instances.empty())
235 while(!instances.empty())
237 T* thisinst = instances.front();
238 instances.pop_front();
G4TemplateAutoLock< G4Mutex > G4AutoLock
G4TemplateRNGHelper< G4long > * G4TemplateRNGHelper< G4long >::instance
#define G4MUTEXDESTROY(mutex)
#define G4MUTEXINIT(mutex)
void Put(const value_type &val) const
friend class G4ThreadLocalSingleton
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