00001 // Variable.h --- 00002 // 00003 // Filename: Variable.h 00004 // Description: 00005 // Author: Subhasis Ray 00006 // Maintainer: 00007 // Created: Fri May 30 19:37:24 2014 (+0530) 00008 // Version: 00009 // Last-Updated: 00010 // By: 00011 // Update #: 0 00012 // URL: 00013 // Keywords: 00014 // Compatibility: 00015 // 00016 // 00017 00018 // Commentary: 00019 // 00020 // Field element for variables in Function class. 00021 // 00022 // 00023 00024 // Change log: 00025 // 00026 // 00027 // 00028 // 00029 // This program is free software; you can redistribute it and/or 00030 // modify it under the terms of the GNU General Public License as 00031 // published by the Free Software Foundation; either version 3, or 00032 // (at your option) any later version. 00033 // 00034 // This program is distributed in the hope that it will be useful, 00035 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00036 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00037 // General Public License for more details. 00038 // 00039 // You should have received a copy of the GNU General Public License 00040 // along with this program; see the file COPYING. If not, write to 00041 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth 00042 // Floor, Boston, MA 02110-1301, USA. 00043 // 00044 // 00045 00046 // Code: 00047 #ifndef _VARIABLE_H 00048 #define _VARIABLE_H 00049 00053 class Variable 00054 { 00055 public: 00056 Variable():value(0.0) 00057 { 00058 }; 00059 Variable(const Variable& rhs): value(rhs.value) 00060 { 00061 ; 00062 } 00063 00064 virtual ~Variable(){}; 00065 00066 void setValue(double v) 00067 { 00068 value = v; 00069 } 00070 00071 virtual void epSetValue(const Eref & e, double v) 00072 { 00073 value = v; 00074 } 00075 00076 double getValue() const 00077 { 00078 return value; 00079 } 00080 00081 void addMsgCallback(const Eref& e, const string& finfoName, ObjId msg, unsigned int msgLookup); 00082 00083 static const Cinfo * initCinfo(); 00084 00085 double value; 00086 }; 00087 00088 #endif 00089 00090 00091 00092 // 00093 // Variable.h ends here