C++ main module for gpm Package  1.0
CORE_Complex.h
Go to the documentation of this file.
1 #ifndef CORE_Complex_H
2 #define CORE_Complex_H
3 
4 #include "CORE_Object.h"
5 #include "CORE_Pointers.h"
6 
7 
8 
25 
26 class CORE_Complex : public CORE_Object {
27  // ATTRIBUTES
28 
29  public:
32  static const tComplex C_I;
33  private:
34  tComplex mComplex;
35 
36 
37  // ASSOCIATIONS
38  private:
39 
40  //CONSTRUCTORS
41  protected:
44  CORE_Complex();
47  CORE_Complex(const tComplex& i);
48  //DESTRUCTIOR
49  protected:
50 
53  ~CORE_Complex();
54 
55  //NEW
56 
57  public:
60  static inline SP::CORE_Complex New() {
61  SP::CORE_Complex c(new CORE_Complex(),CORE_Complex::Delete());
62  return c;
63  };
66  static inline SP::CORE_Complex New(const tComplex& r) {
67  SP::CORE_Complex c(new CORE_Complex(r),CORE_Complex::Delete());
68  return c;
69  };
70  // SET ACCESSORS
71  public:
74  void setComplex(const tComplex& r) {
75  mComplex=r;
76  };
77 
78  // GET ASSECCORS
79  public:
83  tComplex getComplex() const {return mComplex;};
84 
85  // METHODS
86 
87  public:
91  tString toString() const {return toString(mComplex);};
92 
97  return toString(i,7);
98  };
99 
103  static tString toString(complex<double> i,int s);
107  static tString toString(complex<long double> i,int s);
108 
111  static tComplex parseComplex(tString str);
112 
113 
114 
115  // PRIVATE METHODS
116  private:
117 
118 
119 };
120 
121 
122 #endif // end of ifndef
static tComplex parseComplex(tString str)
return the complex associated to the string
Definition: CORE_Complex.cpp:35
#define tComplex
Definition: types.h:37
void setComplex(const tComplex &r)
set the real to r
Definition: CORE_Complex.h:74
this class describes a complex
Definition: CORE_Complex.h:26
~CORE_Complex()
remove
Definition: CORE_Complex.cpp:18
DEFINE_SPTR(CORE_Complex)
static const tComplex C_I
describe the i complex
Definition: CORE_Complex.h:32
static SP::CORE_Complex New(const tComplex &r)
build a complex object
Definition: CORE_Complex.h:66
abstract base class for most classes.
Definition: CORE_Object.h:30
#define tString
Definition: types.h:36
tComplex getComplex() const
get the real
Definition: CORE_Complex.h:83
tString toString() const
return the string associated to the real
Definition: CORE_Complex.h:91
static SP::CORE_Complex New()
build a complex object
Definition: CORE_Complex.h:60
static tString toString(tComplex i)
return the string associated to the real
Definition: CORE_Complex.h:96
CORE_Complex()
create a complex
Definition: CORE_Complex.cpp:11
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106