C++ main module for emicrom 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 
34 private:
36 
37 
38  // ASSOCIATIONS
39 private:
40 
41  //CONSTRUCTORS
42 protected:
45  CORE_Complex();
49  CORE_Complex(const tComplex& i);
50  //DESTRUCTIOR
51 protected:
52 
55  ~CORE_Complex();
56 
57  //NEW
58 
59 public:
63  static inline SP::CORE_Complex New() {
64  SP::CORE_Complex c(new CORE_Complex(),CORE_Complex::Delete());
65  return c;
66  };
71  static inline SP::CORE_Complex New(const tComplex& r) {
72  SP::CORE_Complex c(new CORE_Complex(r),CORE_Complex::Delete());
73  return c;
74  };
75  // SET ACCESSORS
76 public:
80  void setComplex(const tComplex& r) {
81  mComplex=r;
82  };
83 
84  // GET ASSECCORS
85 public:
89  const tComplex& getComplex() const {return mComplex;};
90 
94  const tReal getReal() const {return mComplex.real();};
95 
99  const tReal getImage() const {return mComplex.imag();};
100 
103  static tComplex parseComplex(const tString& str);
104 
105  // METHODS
106 
107 public:
111  tString toString() const {return toString(mComplex);};
112 
113 
117  static tString toString(const complex<tFloat>& c);
121  static tString toString(const complex<tDouble>& c);
125  static tString toString(const complex<tLDouble>& c);
126 
127 
128 
129 
130 
131  // PRIVATE METHODS
132 private:
133 
134 
135 };
136 
137 
138 #endif // end of ifndef
tComplex mComplex
Definition: CORE_Complex.h:35
static tComplex parseComplex(const tString &str)
return the complex associated to the string
Definition: CORE_Complex.cpp:41
tString toString() const
return the string associated to the real
Definition: CORE_Complex.h:111
#define tComplex
Definition: types.h:120
void setComplex(const tComplex &r)
set the complex to r
Definition: CORE_Complex.h:80
this class describes a complex
Definition: CORE_Complex.h:26
~CORE_Complex()
delete the class
Definition: CORE_Complex.cpp:18
DEFINE_SPTR(CORE_Complex)
const tComplex & getComplex() const
get the complex value
Definition: CORE_Complex.h:89
static const tComplex C_I
describe the i complex
Definition: CORE_Complex.h:32
static SP::CORE_Complex New(const tComplex &r)
copy a complex object
Definition: CORE_Complex.h:71
abstract base class for most classes.
Definition: CORE_Object.h:53
#define tString
Definition: types.h:135
const tReal getImage() const
get the image component
Definition: CORE_Complex.h:99
static SP::CORE_Complex New()
build a complex object
Definition: CORE_Complex.h:63
#define tReal
Definition: types.h:118
const tReal getReal() const
get the real component
Definition: CORE_Complex.h:94
CORE_Complex()
create a complex
Definition: CORE_Complex.cpp:11
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141