PyNE C++
extra_types.h
Go to the documentation of this file.
1 
6 #if !defined(_XDRESS_EXTRA_TYPES_)
7 #define _XDRESS_EXTRA_TYPES_
8 
9 #if defined(__cplusplus)
10 namespace extra_types
11 {
13 // typedef struct {
14 // double re; ///< real part
15 // double im; ///< imaginary part
16 // } complex_t;
17 
22  template <class T>
23  class MemoryKnight
24  {
25  public:
26  MemoryKnight(){};
27  ~MemoryKnight(){};
28 
32  T * defnew(){return new T();};
33 
38  T * renew(void * ptr){return new (ptr) T();};
39 
42  void deall(T * ptr){delete ptr;};
43  };
44 
45 // End namespace extra_types
46 }
47 
48 #elif defined(__STDC__)
49 
50 // de nada
51 
52 #endif
53 
54 
56 typedef struct {
57  double re;
58  double im;
59 } xd_complex_t;
60 
61 #endif
62 
complex type struct, matching PyTables definition
Definition: extra_types.h:56
double im
imaginary part
Definition: extra_types.h:58
double re
real part
Definition: extra_types.h:57