Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ThreadLocalSingleton< void > Class Reference

#include <G4ThreadLocalSingleton.hh>

Static Public Member Functions

static void Clear ()
 
template<typename FuncT >
static fvector_t::iterator Insert (FuncT &&_func)
 

Friends

template<class T >
class G4ThreadLocalSingleton
 

Detailed Description

Definition at line 121 of file G4ThreadLocalSingleton.hh.

Member Function Documentation

◆ Clear()

void G4ThreadLocalSingleton< void >::Clear ( )
static

Definition at line 45 of file G4ThreadLocalSingleton.cc.

46{
47 G4AutoLock _lk{ GetMutex() };
48 for(const auto& itr : GetCallbacks())
49 {
50 itr();
51 }
52 GetCallbacks().clear();
53}

◆ Insert()

template<typename FuncT >
static fvector_t::iterator G4ThreadLocalSingleton< void >::Insert ( FuncT && _func)
inlinestatic

Definition at line 136 of file G4ThreadLocalSingleton.hh.

137 {
138 G4AutoLock _lk{ GetMutex() };
139 return GetCallbacks().emplace(GetCallbacks().end(),
140 std::forward<FuncT>(_func));
141 }

Friends And Related Symbol Documentation

◆ G4ThreadLocalSingleton

template<class T >
friend class G4ThreadLocalSingleton
friend

Definition at line 127 of file G4ThreadLocalSingleton.hh.


The documentation for this class was generated from the following files: