Protium
Math and Design Features
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
SignalCatching.h
Go to the documentation of this file.
1 #ifndef Protium_SignalCatching_h_
2 #define Protium_SignalCatching_h_
3 
7 
8 #include <signal.h>
9 
10 #include <iostream>
11 
12 namespace Protium{
13 
14  namespace Private{
15  void signal_callback_handler(int signum);
16  static inline void print_stacktrace(unsigned int stack_depth = 100);
17 
18  }
19 
20  namespace Utilities{
21 
23  protected:
26  public:
27  void Setup(){
32  }
33  private:
36  };
37 
38 
40 
43 
44  public:
45 
46  inline static SignalCatcher& Instance(){
48  }
49 
51  inline ~SignalCatcher( void ) {}
52  };
53 
54  }
55 }
56 
57 
58 #endif //Protium_SignalCatching_h_
59 
static Host & Instance()
Use to get instance.
Definition: Singleton.h:83
static SignalCatcher & Instance()
Use to specify objects which lock by class.
Helper struct to create static instances of classes.
Protium::Singleton::Singleton< SignalCatcher, Protium::Singleton::CreateStatic, Protium::Singleton::DeleteLast, Protium::Threads::StaticLocked > SignalCatcherSingleton
SignalCatchingImplementation & operator=(const SignalCatchingImplementation &)
Defines mutexes and policies to be used by threaded objects.
void signal_callback_handler(int signum)