00001 //# FunctionFactory.h: a class for creating Function objects from Records 00002 //# Copyright (C) 2002 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# 00027 //# $Id$ 00028 00029 #ifndef SCIMATH_ABSTRACTFUNCTIONFACTORY_H 00030 #define SCIMATH_ABSTRACTFUNCTIONFACTORY_H 00031 00032 #include <casacore/casa/aips.h> 00033 #include <casacore/scimath/Functionals/Function.h> 00034 #include <casacore/scimath/Functionals/FunctionFactoryErrors.h> 00035 00036 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00037 00038 //# Forward Declarations 00039 class Record; 00040 00041 // <summary> 00042 // a class for creating Function objects from Records 00043 // </summary> 00044 00045 // <use visibility=export> 00046 00047 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00048 // </reviewed> 00049 00050 // <prerequisite> 00051 // <li> FunctionFactory 00052 // </prerequisite> 00053 // 00054 // <etymology> 00055 // This class is based on the Factory pattern, similar to the 00056 // ApplicationObjectFactory 00057 // </etymology> 00058 // 00059 // <synopsis> 00060 // 00061 // 00062 // 00063 // 00064 // </synopsis> 00065 // 00066 // <example> 00067 // 00068 // 00069 // 00070 // </example> 00071 // 00072 // <motivation> 00073 // 00074 // 00075 // 00076 // </motivation> 00077 // 00078 // <thrown> 00079 // </thrown> 00080 // 00081 // <todo asof="yyyy/mm/dd"> 00082 // </todo> 00083 00084 template<class T> 00085 class FunctionFactory 00086 { 00087 public: 00088 FunctionFactory() {} 00089 FunctionFactory(const FunctionFactory<T>& factory) {} 00090 virtual ~FunctionFactory() {} 00091 virtual Function<T> *create(const Record& gr) const 00092 throw (FunctionFactoryError) = 0; 00093 FunctionFactory<T>& operator=(const FunctionFactory<T>& factory) { 00094 return *this; 00095 } 00096 }; 00097 00098 00099 } //# NAMESPACE CASACORE - END 00100 00101 #endif 00102 00103