SST/macro
statics.h
Go to the documentation of this file.
1 #ifndef sprockit_common_STATICS_H
2 #define sprockit_common_STATICS_H
3 
4 #include <list>
5 
6 namespace sprockit {
7 
8 class statics {
9  public:
10  typedef void (*clear_fxn)(void);
11 
12  static void
14 
15  static void
16  finish();
17 
18  protected:
19  static std::list<clear_fxn>* fxns_;
20 
21 };
22 
23 template <class T>
25  public:
27  statics::register_finish(&T::delete_statics);
28  }
29 };
30 
31 #define free_static_ptr(x) \
32  if (x) delete x; x = 0
33 
34 }
35 
36 #endif // STATICS_H
static void finish()
static std::list< clear_fxn > * fxns_
Definition: statics.h:19
void(* clear_fxn)(void)
Definition: statics.h:10
static void register_finish(clear_fxn fxn)