Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PTL::Backtrace Class Reference

#include <Backtrace.hh>

Classes

struct  actions
 
struct  fake_sigaction
 
struct  fake_siginfo
 

Public Types

using siginfo_t = fake_siginfo
 
using sigaction_t = fake_sigaction
 
using exit_action_t = std::function< void(int)>
 
using frame_func_t = std::function< std::string(const char *)>
 
using signal_set_t = std::set< int >
 

Static Public Member Functions

static void Handler (int, siginfo_t *, void *)
 
static void Message (int, siginfo_t *, std::ostream &)
 
static void ExitAction (int)
 
static int Enable (const std::string &)
 
static int Enable (const signal_set_t &=DefaultSignals())
 
static int Disable (signal_set_t={})
 
static int GetSignal (const std::string &)
 
static std::string Description (int)
 
template<typename FuncT >
static void AddExitAction (FuncT &&)
 
template<size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array< ResultOf_t< FuncT, const char * >, Depth > GetMangled (FuncT &&func=FrameFunctor())
 
template<size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array< ResultOf_t< FuncT, const char * >, Depth > GetDemangled (FuncT &&func=FrameFunctor())
 
static frame_func_tFrameFunctor ()
 
static signal_set_tDefaultSignals ()
 
static actionsGetData ()
 

Detailed Description

Definition at line 715 of file Backtrace.hh.

Member Typedef Documentation

◆ exit_action_t

using PTL::Backtrace::exit_action_t = std::function<void(int)>

Definition at line 725 of file Backtrace.hh.

◆ frame_func_t

using PTL::Backtrace::frame_func_t = std::function<std::string(const char*)>

Definition at line 726 of file Backtrace.hh.

◆ sigaction_t

Definition at line 724 of file Backtrace.hh.

◆ siginfo_t

Definition at line 723 of file Backtrace.hh.

◆ signal_set_t

using PTL::Backtrace::signal_set_t = std::set<int>

Definition at line 727 of file Backtrace.hh.

Member Function Documentation

◆ AddExitAction()

template<typename FuncT >
static void PTL::Backtrace::AddExitAction ( FuncT &&  )
inlinestatic

Definition at line 753 of file Backtrace.hh.

754 {}

◆ DefaultSignals()

static signal_set_t & PTL::Backtrace::DefaultSignals ( )
inlinestatic

Definition at line 784 of file Backtrace.hh.

785 {
786 static signal_set_t _instance = {};
787 return _instance;
788 }
std::set< int > signal_set_t
Definition: Backtrace.hh:727

◆ Description()

static std::string PTL::Backtrace::Description ( int  )
inlinestatic

Definition at line 750 of file Backtrace.hh.

750{ return std::string{}; }

◆ Disable()

static int PTL::Backtrace::Disable ( signal_set_t  = {})
inlinestatic

Definition at line 748 of file Backtrace.hh.

748{}) { return 0; }

◆ Enable() [1/2]

static int PTL::Backtrace::Enable ( const signal_set_t = DefaultSignals())
inlinestatic

Definition at line 747 of file Backtrace.hh.

747{ return 0; }

◆ Enable() [2/2]

static int PTL::Backtrace::Enable ( const std::string &  )
inlinestatic

Definition at line 746 of file Backtrace.hh.

746{ return 0; }

◆ ExitAction()

static void PTL::Backtrace::ExitAction ( int  )
inlinestatic

Definition at line 745 of file Backtrace.hh.

745{}

◆ FrameFunctor()

static frame_func_t & PTL::Backtrace::FrameFunctor ( )
inlinestatic

Definition at line 777 of file Backtrace.hh.

778 {
779 static frame_func_t _instance = [](const char* _s) { return std::string(_s); };
780 return _instance;
781 }
std::function< std::string(const char *)> frame_func_t
Definition: Backtrace.hh:726

◆ GetData()

static actions & PTL::Backtrace::GetData ( )
inlinestatic

Definition at line 790 of file Backtrace.hh.

791 {
792 static auto _instance = actions{};
793 return _instance;
794 }

◆ GetDemangled()

template<size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array< ResultOf_t< FuncT, const char * >, Depth > PTL::Backtrace::GetDemangled ( FuncT &&  func = FrameFunctor())
inlinestatic

Definition at line 767 of file Backtrace.hh.

769 {
770 using type = ResultOf_t<FuncT, const char*>;
771 auto ret = std::array<type, Depth>{};
772 ret.fill(func(""));
773 return ret;
774 }

◆ GetMangled()

template<size_t Depth, size_t Offset = 0, typename FuncT = frame_func_t>
static std::array< ResultOf_t< FuncT, const char * >, Depth > PTL::Backtrace::GetMangled ( FuncT &&  func = FrameFunctor())
inlinestatic

Definition at line 757 of file Backtrace.hh.

759 {
760 using type = ResultOf_t<FuncT, const char*>;
761 auto ret = std::array<type, Depth>{};
762 ret.fill(func(""));
763 return ret;
764 }

◆ GetSignal()

static int PTL::Backtrace::GetSignal ( const std::string &  )
inlinestatic

Definition at line 749 of file Backtrace.hh.

749{ return -1; }

◆ Handler()

static void PTL::Backtrace::Handler ( int  ,
siginfo_t ,
void *   
)
inlinestatic

Definition at line 743 of file Backtrace.hh.

743{}

◆ Message()

static void PTL::Backtrace::Message ( int  ,
siginfo_t ,
std::ostream &   
)
inlinestatic

Definition at line 744 of file Backtrace.hh.

744{}

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