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 //
10 #include <anna/diameter/codec/basetypes/Float32.hpp>
13 //------------------------------------------------------------------------------
14 //--------------------------------------------------------- Float32::codeBasic()
15 //------------------------------------------------------------------------------
16 void anna::diameter::codec::basetypes::Float32::codeBasic(char* buffer, int &size) throw(anna::RuntimeException) {
18 anna::comm::functions::codeFloat(buffer, a_value);
23 //------------------------------------------------------------------------------
24 //------------------------------------------------ Float32::setPrintableString()
25 //------------------------------------------------------------------------------
26 void anna::diameter::codec::basetypes::Float32::setPrintableString(const char * printableString) throw(anna::RuntimeException) {
27 setValue(atof(printableString));
31 //------------------------------------------------------------------------------
32 //------------------------------------------------------------ Float32::decode()
33 //------------------------------------------------------------------------------
34 void anna::diameter::codec::basetypes::Float32::decode(const char* buffer, const int size) throw(anna::RuntimeException) {
36 throw anna::RuntimeException("Float32::decode | Null Buffer provided", ANNA_FILE_LOCATION);
39 throw anna::RuntimeException("Float32::decode | Buffer length must be 4 bytes", ANNA_FILE_LOCATION);
41 a_value = anna::comm::functions::decodeFloat(buffer);