GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
singleton-cleanup.h
Go to the documentation of this file.
1 #if ! defined (octave_singleton_cleanup_h)
2 #define octave_singleton_cleanup_h 1
3 
4 #include "octave-config.h"
5 
6 #include <set>
7 
8 class
9 OCTAVE_API
11 {
12 protected:
13 
14  singleton_cleanup_list (void) : fcn_list () { }
15 
16 public:
17 
18  typedef void (*fptr) (void);
19 
20  ~singleton_cleanup_list (void);
21 
22  static void add (fptr f)
23  {
24  if (instance_ok ())
25  instance->do_add (f);
26  }
27 
28  static void cleanup (void) { delete instance; instance = 0; }
29 
30 private:
31 
33 
34  static bool instance_ok (void);
35 
36  static void cleanup_instance (void) { delete instance; instance = 0; }
37 
38  std::set<fptr> fcn_list;
39 
40  void do_add (fptr f)
41  {
42  fcn_list.insert (f);
43  }
44 
45  // No copying!
46 
48 
50 };
51 
52 #endif
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
static void cleanup_instance(void)
static singleton_cleanup_list * instance
static void add(fptr f)
static void cleanup(void)
FloatComplex(* fptr)(const FloatComplex &, float, int, octave_idx_type &)
Definition: lo-specfun.cc:1724
std::set< fptr > fcn_list