casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MarshButterworthBandpass.h
Go to the documentation of this file.
1 //# MarshButterworthBandpass.h: a Marshallable SimButterworthBandpass
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: aips2-request@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 //#! ========================================================================
27 //# $Id$
28 
29 #ifndef SCIMATH_MARSHBUTTERWORTHBANDPASS_H
30 #define SCIMATH_MARSHBUTTERWORTHBANDPASS_H
31 
32 #include <casacore/casa/aips.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward Declarations
39 
40 // <summary> A Butterworth function class that supports serialization
41 // </summary>
42 
43 // <use visibility=export>
44 
45 // <reviewed reviewer="" date="" tests="" demos="">
46 // </reviewed>
47 
48 // <prerequisite>
49 // <li> <linkto class=Function>Function</linkto>
50 // </prerequisite>
51 //
52 // <etymology>
53 // "Marsh" is short for "Marshallable" which means that the class can
54 // be serialized into a form that can be transmitted to another
55 // execution context. "ButterBandpass" refers to its parent class:
56 // SimButterworthBandpass.
57 // </etymology>
58 //
59 // <synopsis>
60 // This class is a specialization of SimButterworthBandpass class that
61 // supports serialization. That is, it allows one to write the state of the
62 // SimButterworthBandpass function object into a Record. This record
63 // can then be transmitted to another execution context
64 // where it can be "reconstituted" as a new object with
65 // identical state as this one. This documentation focusses on this
66 // serialization functionality (also known as "marshalling"); for details
67 // about the general features of this Butterworth function, see the
68 // <linkto class="SimButterworthBandpass">SimButterworthBandpass</linkto>
69 // class.
70 // </synopsis>
71 //
72 // <example>
73 // </example>
74 //
75 // <motivation>
76 // Making SimButterworthBandpass Marshallable provides a convenient way of
77 // configuring the simulator tool from .
78 // </motivation>
79 //
80 // <thrown>
81 // <li> Assertion in debug mode if attempt is made to address incorrect
82 // coefficients
83 // </thrown>
84 //
85 
86 template<class T>
88  public FunctionMarshallable
89 {
90 public:
91  static const String FUNCTYPE;
92  static const String FUNCFIELDS[];
93 
94  // definitions of the fields stored in a serialized Record. The
95  // actual string names are stored in FUNCFIELDS
96  enum FieldNames {
97  // the minimum cutoff, center, and maximum cutoff values
99  // the orders of the transitions between pass and no-pass
101  // the peak value
103  // the number of supported fields
105  };
106 
107  //# Constructors
108  // create a zero-th order (all-pass) Butterworth bandpass.
111 
112  // create a Butterworth bandpass function.
114  T mincut=T(-1), T maxcut=T(1),
115  T center=T(0), T peak=T(1)) :
116  SimButterworthBandpass<T>(minord, maxord, mincut, maxcut,
117  center, peak),
119  {}
120 
121  // create a fully specified Butterworth polynomial from parameters
122  // stored in a Record.
123  explicit MarshButterworthBandpass(const Record& gr)
125 
126  // create a deep copy of another Butterworth polynomial
127  // <group>
131  SimButterworthBandpass<T>(other), FunctionMarshallable(other) {}
132  // </group>
133 
134  // make a (deep) copy of another Butterworth polynomial
135  // <group>
137  const MarshButterworthBandpass<T> &other)
138  {
141  return *this;
142  }
144  const SimButterworthBandpass<T> &other)
145  {
147  return *this;
148  }
149  // </group>
150 
151  // Destructor
153 
154  // store the state of this Function into a Record
155  virtual void store(Record& gr) const;
156 
157  // Create a copy of this object. The caller is responsible for
158  // deleting the pointer.
159  virtual Function<T> *clone() const {
160  return new MarshButterworthBandpass<T>(*this);
161  }
162 };
163 
164 
165 } //# NAMESPACE CASACORE - END
166 
167 #ifndef CASACORE_NO_AUTO_TEMPLATES
168 #include <casacore/scimath/Functionals/MarshButterworthBandpass.tcc>
169 #endif //# CASACORE_NO_AUTO_TEMPLATES
170 #endif
MarshButterworthBandpass(const MarshButterworthBandpass< T > &other)
MarshButterworthBandpass< T > & operator=(const MarshButterworthBandpass< T > &other)
make a (deep) copy of another Butterworth polynomial
MarshButterworthBandpass(uInt minord, uInt maxord, T mincut=T(-1), T maxcut=T(1), T center=T(0), T peak=T(1))
create a Butterworth bandpass function.
MarshButterworthBandpass< T > & operator=(const SimButterworthBandpass< T > &other)
SimButterworthBandpass< T > & operator=(const SimButterworthBandpass< T > &other)
copy(deep) another Butterworth function
a class for serializing/reconstituting Function objects to/from Records
FieldNames
definitions of the fields stored in a serialized Record.
virtual FunctionMarshallable & operator=(const FunctionMarshallable &other)
the minimum cutoff, center, and maximum cutoff values
A Butterworth function class that supports serialization.
a class for evaluating a Butterworth filter transfer function.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
virtual void store(Record &gr) const
store the state of this Function into a Record
the orders of the transitions between pass and no-pass
MarshButterworthBandpass(const SimButterworthBandpass< T > &other)
create a deep copy of another Butterworth polynomial
String: the storage and methods of handling collections of characters.
Definition: String.h:223
MarshButterworthBandpass()
create a zero-th order (all-pass) Butterworth bandpass.
virtual Function< T > * clone() const
Create a copy of this object.
unsigned int uInt
Definition: aipstype.h:51
#define casacore
&lt;X11/Intrinsic.h&gt; #defines true, false, casacore::Bool, and String.
Definition: X11Intrinsic.h:42