casacore
|
#include <SampledFunctional.h>
Public Member Functions | |
virtual Range | operator() (const uInt &index) const =0 |
Access the specified element of the data. More... | |
virtual uInt | nelements () const =0 |
Return the total size of the data set. More... | |
virtual | ~SampledFunctional () |
The virtual destructor does nothing. More... | |
Public Member Functions inherited from casacore::Functional< uInt, Range > | |
virtual | ~Functional () |
Destructor. More... | |
A base class for indexing into arbitrary data types
Public interface
A Functional is simply a mapping from a Domain type to a Range type. Experimental data is usually sampled, and is can be represented as a mapping from the unsigned integers to an arbitrary Domain.
This abstract class defines an interface for functions that map from the unsigned integers to an arbitrary type. It defines two functions: the operator() function which it inherits from the Functional class, and the nelements function which is necessary to know how many data elements.
This class is useful for freeing the writer of other classes from having to know how how a linear data set is stored or represented. For example, four floating point numbers will probably be stored as a Vector<Float>, and kept in memory for fast access. But 400 million floating point numbers cannot usually be kept in memory, and may be stored on disk as a Table. By using a SampledFunctional writers of other classes (Interpolate1D is an example), can ignore these details if all they are interested in is random access to individual elements of the data.
Because this is an abstract class the example will be inside a function
If all you need to do is random access indexing into arbitrary data sets this class provides a suitable abstraction of that functionality.
Definition at line 101 of file SampledFunctional.h.
|
inlinevirtual |
The virtual destructor does nothing.
Definition at line 110 of file SampledFunctional.h.
|
pure virtual |
Return the total size of the data set.
Implemented in casacore::ScalarSampledFunctional< T >, and casacore::ArraySampledFunctional< T >.
|
pure virtual |
Access the specified element of the data.
Implements casacore::Functional< uInt, Range >.
Implemented in casacore::ScalarSampledFunctional< T >, and casacore::ArraySampledFunctional< T >.