double_t.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 #include <audio/types.hpp>
8 
9 namespace audio {
10  class double_t {
11  private:
12  double m_data;
13  public:
14  double_t() {}
15  double_t(double _value) :
16  m_data(_value) {
17  // nothing to do
18  }
19  // transformation operator:
20  double_t(const audio::int8_8_t& _val);
21  double_t(const audio::int8_16_t& _val);
22  double_t(const audio::int16_16_t& _val);
23  double_t(const audio::int16_32_t& _val);
24  double_t(const audio::int24_24_t& _val);
25  double_t(const audio::int24_32_t& _val);
26  double_t(const audio::int32_32_t& _val);
27  double_t(const audio::int32_64_t& _val);
28  double_t(const audio::int64_64_t& _val);
29  double_t(const audio::float_t& _val);
30  double_t(const audio::double_t& _val);
31  // set operator
32  double_t(int64_t _value, int32_t _flotingPointPosition);
33  void set(int64_t _value, int32_t _flotingPointPosition);
34  void set(double _value);
35  double get() const;
36  float getFloat() const;
37  double getDouble() const;
38  /* ****************************************************
39  * = assigment
40  *****************************************************/
41  const double_t& operator= (const double_t& _obj);
42  /* ****************************************************
43  * == operator
44  *****************************************************/
45  bool operator== (const double_t& _obj) const;
46  /* ****************************************************
47  * != operator
48  *****************************************************/
49  bool operator!= (const double_t& _obj) const;
50  /* ****************************************************
51  * < operator
52  *****************************************************/
53  bool operator< (const audio::double_t& _obj) const;
54  /* ****************************************************
55  * < operator
56  *****************************************************/
57  bool operator<= (const audio::double_t& _obj) const;
58  /* ****************************************************
59  * < operator
60  *****************************************************/
61  bool operator> (const audio::double_t& _obj) const;
62  /* ****************************************************
63  * < operator
64  *****************************************************/
65  bool operator>= (const audio::double_t& _obj) const;
66  /* ****************************************************
67  * += operator
68  *****************************************************/
69  const double_t& operator+= (const double_t& _obj);
70  /* ****************************************************
71  * + operator
72  *****************************************************/
73  double_t operator+ (const double_t& _obj) const;
74  /* ****************************************************
75  * -= operator
76  *****************************************************/
77  const double_t& operator-= (const double_t& _obj);
78  /* ****************************************************
79  * - operator
80  *****************************************************/
81  double_t operator- (const double_t& _obj) const;
82  /* ****************************************************
83  * *= operator
84  *****************************************************/
85  const double_t& operator*= (const double_t& _obj);
86  /* ****************************************************
87  * * operator
88  *****************************************************/
89  double_t operator* (const double_t& _obj) const;
90  /* ****************************************************
91  * /= operator
92  *****************************************************/
93  const double_t& operator/= (const double_t& _obj);
94  /* ****************************************************
95  * / operator
96  *****************************************************/
97  double_t operator/ (const double_t& _obj) const;
98  /* ****************************************************
99  * ++ operator
100  *****************************************************/
101  double_t& operator++();
102  double_t operator++(int _unused);
103  /* ****************************************************
104  * -- operator
105  *****************************************************/
106  double_t& operator--();
107  double_t operator--(int _unused);
108  };
109  std::ostream& operator <<(std::ostream& _os, const audio::double_t& _obj);
110 }
Definition: int32_32_t.hpp:15
Definition: int8_16_t.hpp:17
Definition: int64_64_t.hpp:10
Definition: int24_24_t.hpp:17
Definition: int24_32_t.hpp:17
Definition: int16_32_t.hpp:17
Definition: int16_16_t.hpp:17
Definition: float_t.hpp:11
Audio library namespace.
Definition: channel.hpp:70
Definition: int32_64_t.hpp:10
Definition: int8_8_t.hpp:15
Definition: double_t.hpp:10