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

BxDoubleExtended96.h

00001 // ##################################################################
00002 // Binx
00003 // $Id: BxDoubleExtended96_8h-source.html,v 1.1.1.1 2006/04/19 14:19:02 edikt2 Exp $
00004 //
00005 // Class for extended floating pointer numbers.
00006 // ##################################################################
00007 /*
00008 
00009 //  edikt::BinX
00010 //  www.edikt.org
00011 //  support@edikt.org
00012 
00013 // Copyright (c) 2003 The University of Edinburgh.
00014 
00015 */
00016 
00017 #ifndef __BxDoubleExtended96__
00018 #define __BxDoubleExtended96__
00019 
00020 #include "BxFloat.h"
00021 
00022 /*
00023  * Class implementing the BinX data type 96-bit floating point numbers.
00024  * Instances of this class hold and perform operations on the BinX XML Schema
00025  * type <extended-96>.
00026  * <BR>This class supports the IEEE 754 Extended Floating Point Number Format.  
00027  * Machines that support extended floating point number formats
00028  * may support 80-bit extensions, 96-bit extensions, or 128-bit extensions.
00029  * BinX defines all of these as primitive data types,
00030  * but individual platforms will support only a subset of these data types.
00031  * For this reason, this class also implements conversion operations
00032  * so that an 80-bit extended floating point numbers
00033  * can be read from a binary data file by an executing system
00034  * that supports only 96-bit extended floating point number representation.
00035  * <BR>It is possible for a binary data file to contain extended floating point numbers
00036  * with greater precision than the floating point number representation
00037  * supported by the executing machine.
00038  * For example, a file may contain floating point numbers with 96-bit precision
00039  * and the executing platform supports only an 80-bit extended format.
00040  * In this case, the 96-bit value is read from the binary data file
00041  * and held in an object of type BxDoubleExtended96.
00042  * When the BxDoubleExtended96 object is accessed it will be converted
00043  * to a floating point number with 80-bit precision.
00044  * If overflow occurs in the conversion process,
00045  * an error is reported and an NaN is returned.
00046  * A generalized conversion method is implemented by the base class BxFloat.
00047  * <BR>This class also implements methods to:
00048  * <UL>
00049  * <li>Serialize a floating point value to a file stream</li>
00050  * <li>Parse and store an individual floating point value from a file or a stream buffer</li>
00051  * </UL>
00052  * <BR><B>Implementation Notes:</B><BR>
00053  * BinX implements extended floating point numbers
00054  * using the C-language type "long double". 
00055  * <BR><B>Since:</B>  BinX version 1.0.
00056  */
00057 class DECLSPEC BxDoubleExtended96 : public BxFloat
00058 {
00059 public:
00060     BxDoubleExtended96();
00061     BxDoubleExtended96(const bx_extended);
00062     BxDoubleExtended96(const BxDoubleExtended96& copy);
00063     virtual ~BxDoubleExtended96();
00064     virtual BxDoubleExtended96* clone() const;
00065 
00066     virtual char* className() const { return "BxDoubleExtended96"; } //<Returns the null-terminated string "BxDoubleExtended96".
00067     virtual void print();
00068     virtual bool equals(const BxDataObject&) const;
00069     virtual char * toString(bool xml); //new a string for the value
00070     virtual bool parseValue(const char *);
00071     virtual bool readFromFile();
00072     virtual void readFromBuffer(const byte *);  //read data from a buffer
00073 
00074     BxDoubleExtended96& operator=(const bx_extended);
00075 };
00076 
00077 #endif

Generated on Fri May 6 13:36:17 2005 for edikt::BinX by doxygen 1.3.3