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

lkfloat.h

00001 /* liblookdb: lkfloat.h - Float representation
00002     Copyright (C) 1998-2001 LOOK Systems
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Lesser General Public License for more details.
00013 
00014     You should have received a copy of the GNU Lesser General Public
00015     License along with this library; if not, write to the Free Software
00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 */
00018 #ifndef LIBLOOKDB_LKFLOAT_H
00019 #define LIBLOOKDB_LKFLOAT_H
00020 
00021 // $Id: lkfloat.h,v 1.4 2001/07/04 15:53:18 clive Exp $
00022 
00023 #include "looktypes.h"
00024 #include "lktypebase.h"
00025 
00026 #include "lkstring.h"
00027 
00028 namespace look {
00029 
00030 // *****************************************************
00031 // LookFloat class
00032 // *****************************************************
00033 
00035 
00039 class LOOKTYPES_DLL LookFloat : public LookTypeBase
00040 {
00041 public:
00042 // Constructors.
00043         LookFloat( double theValue = 0.0 );
00044 
00045 // Destructor.
00046         ~LookFloat( void );
00047 
00048 // Copy constructor.
00049         LookFloat( const LookFloat &theOther );
00050 
00051 // Assignment operator.
00052         LookFloat &operator=( const LookFloat &theOther );
00053 
00054 // get a copy
00055         LookTypeBase* GetNewCopy( void ) const;
00056 
00057 // get my id
00058         long GetTypeID( void ) const;
00059 
00060 // cast to double
00061         operator double( void ) const;
00062 
00063 // Conversion to and from strings
00064         bool Set( const LookString& theString );
00065         LookString GetString( int aPrecision ) const;
00066         LookString GetStrippedString( int aPrecision ) const;
00067 
00068 // other operators
00069         LookFloat& operator+=( const LookFloat & );
00070         LookFloat& operator-=( const LookFloat & );
00071 
00072         LookFloat operator+( const LookFloat & ) const;
00073         LookFloat operator-( const LookFloat & ) const;
00074 
00075 // rounds to nearest, not down
00076         long GetRoundedInteger( void ) const;
00077 
00078         bool LessEqual( const LookFloat& theOtherFloat, int thePrecision ) const;
00079         bool LessThan( const LookFloat& theOtherFloat, int thePrecision ) const;
00080         bool IsEqual( const LookFloat& theOtherFloat, int thePrecision ) const;
00081         bool IsZero( int thePrecision ) const;
00082 
00083 protected:
00085    double itsValue;
00086 };
00087 
00088 
00089 } // end of "look" namespace
00090 #endif

Generated at Thu Jan 17 12:53:06 2002 for liblookdb by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001