casacore
Loading...
Searching...
No Matches
SpecificFunctionFactory.h
Go to the documentation of this file.
1// # SpecificFunctionFactory.h: a class for creating a Function object from Records
2// # Copyright (C) 2002
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: casa-feedback@nrao.edu.
21// # Postal address: AIPS++ Project Office
22// # National Radio Astronomy Observatory
23// # 520 Edgemont Road
24// # Charlottesville, VA 22903-2475 USA
25
26#ifndef SCIMATH_SPECIFICFUNCTIONFACTORY_H
27#define SCIMATH_SPECIFICFUNCTIONFACTORY_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/scimath/Functionals/Function.h>
31#include <casacore/scimath/Functionals/AbstractFunctionFactory.h>
32
33namespace casacore { // # NAMESPACE CASACORE - BEGIN
34
35// # Forward Declarations
36class Record;
37
38// <summary>
39//
40//
41//
42//
43//
44// </summary>
45
46// <use visibility=export>
47
48// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
49// </reviewed>
50
51// <prerequisite>
52// <li> FunctionFactory
53// </prerequisite>
54//
55// <etymology>
56// This class is based on the Factory pattern, similar to the
57// ApplicationObjectFactory
58// </etymology>
59//
60// <synopsis>
61//
62//
63//
64//
65// </synopsis>
66//
67// <example>
68//
69//
70//
71// </example>
72//
73// <motivation>
74//
75//
76//
77// </motivation>
78//
79// <templating arg=T>
80// <li> F class must be a subclass of Function<T>
81// <li> F class must have a constructor for the form F(const Record&)
82// </templating>
83//
84// <thrown>
85// <li>
86// <li>
87// </thrown>
88//
89// <todo asof="yyyy/mm/dd">
90// <li>
91// <li>
92// <li>
93// </todo>
94template <class T, class F>
96 public:
100 virtual Function<T>* create(const Record& gr) const throw(FunctionFactoryError) {
101 return new F(gr);
102 }
106};
107
108} // namespace casacore
109
110#endif
SpecificFunctionFactory(const SpecificFunctionFactory< T, F > &factory)
virtual Function< T > * create(const Record &gr) const
SpecificFunctionFactory< T, F > & operator=(const SpecificFunctionFactory< T, F > &factory)
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28