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_Unsigned64_hpp
10 #define anna_diameter_codec_basetypes_Unsigned64_hpp
14 #include <anna/diameter/codec/basetypes/AvpData.hpp>
16 #include <anna/core/util/defines.hpp>
30 * Diameter Unsigned64 container
32 class Unsigned64 : public AvpData {
37 // Mandatory for basic diameter type:
38 void codeBasic(char* buffer, int &size) throw(anna::RuntimeException);
39 void setPrintableString(const char * printableString) throw(anna::RuntimeException);
44 // Class-specific ////////////////////////////////////////////////////////////////////////////////////
47 * Gets the Unsigned64 value
49 * @return Unsigned64 value
51 const U64& getValue() const throw() { return a_value; }
54 * Sets the Unsigned64 value
56 * @param value Unsigned64 value
58 void setValue(const U64& value) throw() { a_value = value; }
60 //////////////////////////////////////////////////////////////////////////////////////////////////////
65 virtual std::string getFormatName() const throw() { return "Unsigned64"; }
66 virtual int getSize() const throw() { return 8; }
71 std::string asPrintableString() throw(anna::RuntimeException) {
72 return anna::functions::asString((anna::U64)a_value);
75 std::string asString() throw(anna::RuntimeException) {
76 return asPrintableString();
82 void decode(const char* buffer, const int size) throw(anna::RuntimeException);