casa
$Rev:20696$
|
00001 //# SpecificFunctionFactory.h: a class for creating a Function object 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: SpecificFunctionFactory.h 18093 2004-11-30 17:51:10Z ddebonis $ 00028 00029 #ifndef SCIMATH_SPECIFICFUNCTIONFACTORY_H 00030 #define SCIMATH_SPECIFICFUNCTIONFACTORY_H 00031 00032 #include <scimath/Functionals/Function.h> 00033 #include <scimath/Functionals/AbstractFunctionFactory.h> 00034 00035 namespace casa { //# NAMESPACE CASA - BEGIN 00036 00037 //# Forward Declarations 00038 class Record; 00039 00040 // <summary> 00041 // 00042 // 00043 // 00044 // 00045 // 00046 // </summary> 00047 00048 // <use visibility=export> 00049 00050 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00051 // </reviewed> 00052 00053 // <prerequisite> 00054 // <li> FunctionFactory 00055 // </prerequisite> 00056 // 00057 // <etymology> 00058 // This class is based on the Factory pattern, similar to the 00059 // ApplicationObjectFactory 00060 // </etymology> 00061 // 00062 // <synopsis> 00063 // 00064 // 00065 // 00066 // 00067 // </synopsis> 00068 // 00069 // <example> 00070 // 00071 // 00072 // 00073 // </example> 00074 // 00075 // <motivation> 00076 // 00077 // 00078 // 00079 // </motivation> 00080 // 00081 // <templating arg=T> 00082 // <li> F class must be a subclass of Function<T> 00083 // <li> F class must have a constructor for the form F(const Record&) 00084 // </templating> 00085 // 00086 // <thrown> 00087 // <li> 00088 // <li> 00089 // </thrown> 00090 // 00091 // <todo asof="yyyy/mm/dd"> 00092 // <li> 00093 // <li> 00094 // <li> 00095 // </todo> 00096 template<class T, class F> 00097 class SpecificFunctionFactory : public FunctionFactory<T> 00098 { 00099 public: 00100 SpecificFunctionFactory() {} 00101 SpecificFunctionFactory(const SpecificFunctionFactory<T,F>& factory) {} 00102 virtual ~SpecificFunctionFactory() {} 00103 virtual Function<T> *create(const Record& gr) const 00104 throw (FunctionFactoryError) 00105 { 00106 return new F(gr); 00107 } 00108 SpecificFunctionFactory<T,F>& 00109 operator=(const SpecificFunctionFactory<T,F>& factory) 00110 { 00111 return *this; 00112 } 00113 }; 00114 00115 00116 } //# NAMESPACE CASA - END 00117 00118 #endif 00119 00120