Main Page | Class Hierarchy | Compound List | File List | Compound Members

BxDouble64 Class Reference

Class implementing the BinX data type 64-bit floating point numbers. More...

#include <BxDouble64.h>

Inheritance diagram for BxDouble64:

BxFloat BxDataObject BxObject List of all members.

Public Member Functions

 BxDouble64 ()
 BxDouble64 (const bx_double64)
 BxDouble64 (const BxDouble64 &copy)
virtual bool equals (const BxDataObject &) const
virtual char * toString (bool xml)
virtual bool parseValue (const char *)
BxDouble64operator= (const bx_double64)

Detailed Description

Instances of this class hold and perform operations on the BinX XML Schema type <double-64>. The class provides manipulations such as:
Since: BinX version 1.0.


Constructor & Destructor Documentation

BxDouble64::BxDouble64  ) 
 

Default constructor.

Constructs and initialises an instance of the class BxDouble64. Default attribute values are assigned as follows:

       sizeInBits_ = 64;
       sizeInBytes_ = 8; 
       sizeInAll_ = 8; 
   

BxDouble64::BxDouble64 const bx_double64  d64  ) 
 

Construct a BxDouble64 instance and assign it a specified 64-bit floating point number.

Constructs and initialises an instance of the class BxDouble64.

Parameters:
d64 A 64-bit floating point value to initialise the new BxDouble64 object.

BxDouble64::BxDouble64 const BxDouble64 copy  ) 
 

Construct a BxDouble64 instance by copying a specified BxDouble64 instance.

Constructs and initialises an instance of the class BxDouble64.

Parameters:
copy A reference to the BxDouble64 instance to copy.


Member Function Documentation

bool BxDouble64::equals const BxDataObject dataObj  )  const [virtual]
 

Compares the value of a specified data object with the value of this object.

In this method, two objects are considered to be equal if they are of the same BinX object type and if they store the same data value. Also, only primitive BinX data types implement this method.


Note: Byte order differences are not compensated for in this test. Hence, two 64-bit floating point numbers that are equal in value, but represented in different byte orders would be found to be unequal.

Parameters:
dataObj A reference to another data object to be compared with this object.
Returns:
true If the data type and value of the two objects are equal,
false If the objects differ in type or value.

Reimplemented from BxDataObject.

BxDouble64 & BxDouble64::operator= const bx_double64  d64  ) 
 

Overloaded operator = assigns a 64-bit floating point value from a specified source to a BxDouble64 destination object.

Parameters:
d64 A 64-bit floating point value to be assigned to a BxDouble64 object.
Returns:
A reference to this BxDouble64 object after the assignment has been performed.

bool BxDouble64::parseValue const char *  strVal  )  [virtual]
 

Extract a 64-bit floating point value from a specified string and assign the value to this object.

The data contained in the input string is assumed to be in ASCII representation, and to contain a double-precision floating point number represented in exponential format. Exponential format is defined by the following normal form expressions: Note - in normal form expressions, angle-brackets are used to denote variables, whose valid values are defined in subsequent expressions. The angle brackets do not indicate tags or elements as they do in XML notation.

       <double64-in-ascii> = <modulus> | (<modulus><exponent>)
       where
           <modulus> = <signed-modulus> | <unsigned-modulus>
           <exponent> = <signed-exponent> | <unsigned-exponent>
           <signed-modulus> = "+" | "-" &lt;modulus-value>
           <unsigned-modulus> = <modulus-value>
           <signed-exponent> = ("E" | "e") ("+" | "-") <exponent-value>
           <unsigned-exponent> = <exponent-value>
           <modulus-value> = <digits&gt;* ("." | "") <digits>*
           <exponent-value> = <digits&gt; | (<digits> <digits>)
           <digits> = "0" | "1" | "2"| "3" | "4" | "5" | "6" | "7" | "8" | "9"
   
The definition specifies that a well-formed ASCII representation of a floating number consists of a modulus or a modulus followed by an exponent. The modulus value must meet the following constraints:
  • It may be signed or unsigned.
  • The number of digits is limited by the precision (number of bits) that can be stored in a BxDouble64 object.
  • It optionally contains a decimal point.
The exponent value must meet the following constraints:
  • It may be signed or unsigned.
  • Upper or lower case "e" must we used as a prefix to the exponent value
  • The number of digits is at most two.
The input string must not contain symbols, except those allowed by the normal form expressions above. The input string must be null-terminated. All bytes of the input string are used in the conversion process. The input bytes is converted to a double precision floating point representation, in conformance with the definiton of a BxDouble64 object value. The converted value is stored as the value of this object. Only primitive BinX data types implement this method.
Parameters:
strVal A pointer to an ASCII string containing a double precision floating point value.
Returns:
true If value conversion was successful,
false If the input string is NULL.

Reimplemented from BxDataObject.

char * BxDouble64::toString bool  xml  )  [virtual]
 

Return a string containing the DataBinX XML element (or printable value only ) for the value of this BxDouble64 object.

The DataBinx representation of a BxDouble64 object value consists of:

  • The BinX XML tags, <double-64> and </double-64>
  • The binary data value of this object, converted to a printable representation
Example Return Result:
       <double-64>-0.749829734092e-14</double-64>
   

This method allocates memory to hold the returned string. The caller is responsible for releasing the memory when the string is no longer needed.
If the BinX XML tags are not required, then the input boolean flag can be used to request that only the converted binary data value be included in the result string.
Only BinX primitive data types implement this method.
Parameters:
xml A boolean indicating whether to include BinX XML tags or not.
Returns:
A string buffer containing the DataBinX representation of the value of this object, if the input flag is true,
A string buffer containing the printable representation of the value of this object, if the input flag is false.

Reimplemented from BxDataObject.


The documentation for this class was generated from the following files:
Generated on Fri May 6 13:36:19 2005 for edikt::BinX by doxygen 1.3.3