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

values/Float.h

00001 // Float.h -- Interface to `float' values in CSP variables.
00002 
00003 /*
00004  * Copyright (C) 1997, 1998 Tudor Hulubei <tudor@hulubei.net>.
00005  *
00006  * This library is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as
00008  * published by the Free Software Foundation; either version 2, or (at
00009  * your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA,
00019  * 02111-1307, USA.
00020  */
00021 
00022 // $Id: values_2Float_8h-source.html,v 1.1 2005/05/25 12:37:18 tudor Exp $
00023 
00024 #ifndef _CSP_VALUES_Float_H
00025 #define _CSP_VALUES_Float_H
00026 
00027 
00028 CSP_NAMESPACE_BEGIN(csp);
00029 CSP_NAMESPACE_BEGIN(values);
00030 
00031 
00036 class CSP_API Float :
00037     public Value
00038 {
00039   public:
00040     Float() : m_value(0) {}
00041     Float(const float v) : m_value(v) {}
00042     Float(const Float& v) : Value() { m_value = v.m_value; }
00043 
00044     // Assignment operator.
00045     Float& operator=(const Float& v)
00046     {
00047         Value::operator=(v);
00048         m_value = v.m_value;
00049         return *this;
00050     }
00051 
00052     operator float() const { return m_value; }
00053 
00054     virtual wostream& print(wostream& wos) const
00055     {
00056         return wos << m_value << L"(" << id() << L")";
00057     }
00058 
00059   private:
00060     float m_value;
00061 };
00062 
00063 
00064 CSP_NAMESPACE_END(values);
00065 CSP_NAMESPACE_END(csp);
00066 
00067 
00068 #endif // _CSP_VALUES_Float_H
00069 
00070 // Local Variables:
00071 // mode: C++
00072 // End:

Generated on Wed May 25 12:21:14 2005 for csp.kdevelop by  doxygen 1.3.9.1