1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
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 //
9 #ifndef anna_diameter_codec_basetypes_Float64_hpp
10 #define anna_diameter_codec_basetypes_Float64_hpp
14 #include <anna/diameter/codec/basetypes/AvpData.hpp>
16 #include <anna/config/defines.hpp>
18 #include <anna/comm/functions.hpp>
31 * Diameter Float64 container
33 class Float64 : public AvpData {
38 // Mandatory for basic diameter type:
39 void codeBasic(char* buffer, int &size) throw(anna::RuntimeException);
40 void setPrintableString(const char * printableString) throw(anna::RuntimeException);
44 virtual ~Float64() {;}
46 // Class-specific ////////////////////////////////////////////////////////////////////////////////////
49 * Gets the Float64 value
51 * @return Float64 value
53 const F64& getValue() const throw() { return a_value; }
56 * Sets the Float64 value
58 * @param value Float64 value
60 void setValue(const F64& value) throw() { a_value = value; }
62 //////////////////////////////////////////////////////////////////////////////////////////////////////
67 virtual std::string getFormatName() const throw() { return "Float64"; }
68 virtual int getSize() const throw() { return 8; }
73 std::string asPrintableString() throw(anna::RuntimeException) {
74 return anna::functions::asString(a_value);
77 std::string asString() throw(anna::RuntimeException) {
78 return asPrintableString();
84 void decode(const char* buffer, const int size) throw(anna::RuntimeException);