casacore
Loading...
Searching...
No Matches
FunctionMarshallable.h
Go to the documentation of this file.
1//# FunctionMarshallable.h: a class for serializing/reconstituting Function objects to/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_FUNCTIONMARSHALLABLE_H
27#define SCIMATH_FUNCTIONMARSHALLABLE_H
28
29#include <casacore/casa/aips.h>
30#include <casacore/scimath/Functionals/Function.h>
31#include <casacore/scimath/Functionals/FunctionFactoryErrors.h>
32#include <casacore/scimath/Functionals/SerialHelper.h>
33
34namespace casacore { //# NAMESPACE CASACORE - BEGIN
35
36// <summary>
37// a class for serializing/reconstituting Function objects to/from Records
38// </summary>
39
40// <use visibility=export>
41
42// <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
43// </reviewed>
44
45// <prerequisite>
46// <li> FunctionFactory
47// <li> Function
48// </prerequisite>
49//
50// <etymology>
51// Marshalling (a.k.a. serialization) is the process of converting the
52// state of an object into a transmitable form so that an another object with
53// identical state can be created in another execution context. This class
54// defines an interface for marshalling Functions.
55// </etymology>
56//
57// <synopsis>
58//
59//
60//
61//
62// </synopsis>
63//
64// <example>
65//
66//
67//
68// </example>
69//
70// <motivation>
71//
72//
73//
74// </motivation>
75//
76// <thrown>
77// </thrown>
78//
79// <todo asof="yyyy/mm/dd">
80// </todo>
81
83public:
84
85 // create a FunctionMarshallable. <em>functype</em> is the name that
86 // store() will load into the Record's <tt>functype</tt> field.
87 FunctionMarshallable(const String& functype) : ftype(functype) {}
89 ftype = other.ftype;
90 }
92
93 // store the state of this Function into a Record
94 // <thrown>
95 // <li> InvalidSerializationError if an error during serialization
96 // </thrown>
97 virtual void store(Record& gr) const = 0;
98
99 virtual FunctionMarshallable&
101 {
102 ftype = other.ftype;
103 return *this;
104 }
105
106 // return the name representing the Function type that will be placed
107 // in the <tt>functype</tt> field of Record passed to store().
108 const String& getFuncType() const { return ftype; }
109
110 // load functype field into the given Record
111 void loadFuncType(Record& gr) const {
113 }
114
115private:
117
119};
120
121
122} //# NAMESPACE CASACORE - END
123
124#endif
125
126
const String & getFuncType() const
return the name representing the Function type that will be placed in the functype field of Record pa...
void loadFuncType(Record &gr) const
load functype field into the given Record
FunctionMarshallable(const FunctionMarshallable &other)
virtual FunctionMarshallable & operator=(const FunctionMarshallable &other)
virtual void store(Record &gr) const =0
store the state of this Function into a Record
FunctionMarshallable(const String &functype)
create a FunctionMarshallable.
void define(const RecordFieldId &, Bool value)
Define a value for the given field.
static const String FUNCTYPE
String: the storage and methods of handling collections of characters.
Definition String.h:223
const Char * c_str() const
Get char array.
Definition String.h:555
this file contains all the compiler specific defines
Definition mainpage.dox:28