ulxr::Double Class Reference
[Value types in an XML-RPC call]

Implementation of a floating point value. More...

#include <ulxr_value.h>

Inheritance diagram for ulxr::Double:

Inheritance graph
[legend]
Collaboration diagram for ulxr::Double:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Double ()
 Default constructor for a Double.
 Double (double d)
 Constructs a Double.
 Double (const CppString &s)
 Constructs a Double.
virtual ~Double ()
 Destroys the Value.
double getDouble () const
 Returns the current value.
void setDouble (const double newval)
 Sets a new content.
virtual ValueBasecloneValue () const
 Creates a copy of the actual object.
virtual CppString getSignature (bool deep=false) const
 Returns the signature of value.
virtual std::string getWbXml () const
 Returns the call as binary xml string.
virtual CppString getXml (int indent=0) const
 Returns the value as xml string.

Static Public Member Functions

static CppString getValueName ()
 Returns the xml name of the Value.
static bool setScientificMode (bool scientific)
 Switches the conversion mode for double values.

Private Attributes

double val

Static Private Attributes

static bool scientific

Detailed Description

Implementation of a floating point value.

The range of double values is system dependent as far as I know but should at least cover a "double" in C.

Definition at line 733 of file ulxr_value.h.


Constructor & Destructor Documentation

ulxr::Double::Double (  ) 

Default constructor for a Double.

Definition at line 806 of file ulxr_value.cpp.

ulxr::Double::Double ( double  d  ) 

Constructs a Double.

Parameters:
d value for the construction

Definition at line 812 of file ulxr_value.cpp.

ulxr::Double::Double ( const CppString s  ) 

Constructs a Double.

Parameters:
s value for the construction as number string

Definition at line 824 of file ulxr_value.cpp.

References ulxr::getLatin1(), and val.

ulxr::Double::~Double (  )  [virtual]

Destroys the Value.

Definition at line 819 of file ulxr_value.cpp.


Member Function Documentation

double ulxr::Double::getDouble (  )  const

Returns the current value.

Returns:
current value

Definition at line 907 of file ulxr_value.cpp.

References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.

void ulxr::Double::setDouble ( const double  newval  ) 

Sets a new content.

Parameters:
newval the new content

Definition at line 914 of file ulxr_value.cpp.

References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.

ValueBase * ulxr::Double::cloneValue (  )  const [virtual]

Creates a copy of the actual object.

Returns:
pointer to the copy

Implements ulxr::ValueBase.

Definition at line 831 of file ulxr_value.cpp.

References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.

CppString ulxr::Double::getSignature ( bool  deep = false  )  const [virtual]

Returns the signature of value.

The signature consists of its type name.

Parameters:
deep if nested types exist, include them
Returns:
The signature

Implements ulxr::ValueBase.

Definition at line 838 of file ulxr_value.cpp.

References ulxr::RpcDouble, and ULXR_ASSERT_RPCTYPE.

CppString ulxr::Double::getValueName (  )  [static]

Returns the xml name of the Value.

Returns:
value name

Definition at line 845 of file ulxr_value.cpp.

References ULXR_PCHAR.

std::string ulxr::Double::getWbXml (  )  const [virtual]

Returns the call as binary xml string.

The method call is converted to a wbxml sequence. It is prepended with the necessary xml procession instruction with version and encoding set to UTF-8.

Returns:
The wbxml content

Implements ulxr::ValueBase.

Definition at line 859 of file ulxr_value.cpp.

References ulxr::ApplicationError, ulxr::getWbXmlString(), ulxr::RpcDouble, ULXR_ASSERT_RPCTYPE, ULXR_GET_STRING, ulxr_i18n, ULXR_PCHAR, ulxr_snprintf, ulxr::ValueParserWb::wbToken_Double, ulxr::ValueParserWb::wbToken_Value, and ulxr::WbXmlParser::wbxml_END.

CppString ulxr::Double::getXml ( int  indent = 0  )  const [virtual]

Returns the value as xml string.

The content and its type name is converted to an xml text. The structure of the text is indented to facilitate easy reading of larger blocks.

Parameters:
indent current indentation level
Returns:
The xml content

Implements ulxr::ValueBase.

Definition at line 884 of file ulxr_value.cpp.

References ulxr::ApplicationError, ulxr::getXmlIndent(), ulxr::RpcDouble, ULXR_ASSERT_RPCTYPE, ULXR_GET_STRING, ulxr_i18n, ULXR_PCHAR, and ulxr_snprintf.

bool ulxr::Double::setScientificMode ( bool  scientific  )  [static]

Switches the conversion mode for double values.

Large numbers create large strings for the number without necessarily increasing the accuracy. For that reason it is possible to switch to scientific mode which uses only the significant 15 or 16 digits.

Definition at line 851 of file ulxr_value.cpp.


Member Data Documentation

double ulxr::Double::val [private]

Definition at line 813 of file ulxr_value.h.

Referenced by Double().

bool ulxr::Double::scientific [static, private]

Definition at line 815 of file ulxr_value.h.


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 20:09:10 2007 for ulxmlrpcpp by  doxygen 1.5.1