00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program 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 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: FunctionExpression.cpp,v 1.31 2007/08/14 14:35:06 delpinux Exp $ 00019 00020 #include <FunctionExpression.hpp> 00021 #include <FunctionExpressionValue.hpp> 00022 00023 #include <ScalarFunctionBase.hpp> 00024 #include <ErrorHandler.hpp> 00025 00026 std::ostream& 00027 FunctionExpression:: 00028 put(std::ostream& os) const 00029 { 00030 os << *__scalarFunction; 00031 return os; 00032 } 00033 00034 bool 00035 FunctionExpression:: 00036 hasBoundaryExpression() const 00037 { 00038 return false; 00039 } 00040 00041 const FunctionExpression::FunctionType& 00042 FunctionExpression:: 00043 type() const 00044 { 00045 return __type; 00046 } 00047 00048 ConstReferenceCounting<ScalarFunctionBase> 00049 FunctionExpression:: 00050 function() const 00051 { 00052 ASSERT(__scalarFunction != 0); 00053 return __scalarFunction; 00054 } 00055 00056 ReferenceCounting<FunctionExpression> 00057 FunctionExpression:: 00058 value() 00059 { 00060 ASSERT(__scalarFunction != 0); 00061 return new FunctionExpressionValue(__scalarFunction, 00062 this->hasBoundaryExpression()); 00063 } 00064 00065 FunctionExpression:: 00066 FunctionExpression(const FunctionExpression& e) 00067 : Expression(e), 00068 __type(e.__type), 00069 __unknown(e.__unknown), 00070 __scalarFunction(e.__scalarFunction) 00071 { 00072 ; 00073 } 00074 00075 FunctionExpression:: 00076 FunctionExpression(const FunctionExpression::FunctionType& type) 00077 : Expression(Expression::function), 00078 __type(type), 00079 __unknown(false), 00080 __scalarFunction(0) 00081 { 00082 ; 00083 } 00084 00085 FunctionExpression:: 00086 ~FunctionExpression() 00087 { 00088 ; 00089 }
1.5.6