ANNA Suite  2020b
Multipurpose development suite for Telco applications
Float64.hpp
Go to the documentation of this file.
1 // ANNA - Anna is Not Nothingness Anymore //
2 // //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
4 // //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7 
8 
9 #ifndef anna_diameter_codec_basetypes_Float64_hpp
10 #define anna_diameter_codec_basetypes_Float64_hpp
11 
12 
13 // Local
15 
16 #include <anna/config/defines.hpp>
17 
18 #include <anna/comm/functions.hpp>
19 
20 namespace anna {
21 
22 namespace diameter {
23 
24 namespace codec {
25 
26 class Avp;
27 
28 namespace basetypes {
29 
33 class Float64 : public AvpData {
34 
35  F64 a_value;
36 
37 
38  // Mandatory for basic diameter type:
39  void codeBasic(char* buffer, int &size) noexcept(false);
40  void setPrintableString(const char * printableString) noexcept(false);
41 
42 public:
43 
44  virtual ~Float64() {;}
45 
46  // Class-specific ////////////////////////////////////////////////////////////////////////////////////
47  //
53  const F64& getValue() const { return a_value; }
54 
60  void setValue(const F64& value) { a_value = value; }
61  //
63 
64 
65  // gets
66 
67  virtual std::string getFormatName() const { return "Float64"; }
68  virtual int getSize() const { return 8; }
69 
70 
71  // helpers
72 
73  std::string asPrintableString() noexcept(false) {
74  return anna::functions::asString(a_value);
75  }
76 
77  std::string asString() noexcept(false) {
78  return asPrintableString();
79  }
80 
81 
82  // sets
83 
84  void decode(const char* buffer, const int size) noexcept(false);
85 };
86 
87 }
88 }
89 }
90 }
91 
92 #endif
void decode(const char *buffer, const int size) noexcept(false)
static std::string asString(const int number)
virtual int getSize() const
Definition: Float64.hpp:68
const F64 & getValue() const
Definition: Float64.hpp:53
void setValue(const F64 &value)
Definition: Float64.hpp:60
virtual std::string getFormatName() const
Definition: Float64.hpp:67
Definition: app.hpp:12
std::string asString() noexcept(false)
Definition: Float64.hpp:77
virtual ~Float64()
Definition: Float64.hpp:44
std::string asPrintableString() noexcept(false)
Definition: Float64.hpp:73
double F64
Definition: defines.hpp:90