Public Members
- using ForeignBaseParameterAccessor<T>::operator()
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
Etymology
Synopsis
This class connects the Tasking Parameter system for non-Glish standard
datatype structures. Examples are Quantities, Measures and SkyComponents.
All of these have a record representation in Glish, and a Data structure in
C++.
The system (see ForeignArrayParameterAccess.h) can also handle Vectors
and Arrays of these structures.
To include a new structure in the Tasking system, the following steps are
necessary:
- The Glishrecord must, in general, have an ::id attribute to identify
the structure type (e.g. meas, quant, comp) (at the moment not
essential, but could become so in future)
- If the GlishRecord represents an Array (or Vector) of data records,
it must contain a ::shape attribute
- Include the declaration of your structure in ParameterImpl.h
- Define the parameter accessor for your type in ParameterImplN.cc
(N to get separate object modules to prevent unnecessary bloat)
- Add the appropiate Parameter<> templates
- Add the appropiate ParameterAccessor<> templates
- If the to/fromRecord() methods can be called directly:
Add the appropiate ForeignParameterAccessor<> templates, and, if
necessary, the ForeignArrayParameterAccessor<> and
ForeignVectorParameterAccessor<> templates
- If the to/fromRecord() methods cannot be called directly:
Add the appropiate ForeignNSParameterAccessor<> templates, and, if
necessary, the ForeignNSArrayParameterAccessor<> and
ForeignNSVectorParameterAccessor<> templates
and: Add the to/fromRecord/fromString implementation in
ForeignNParameterAccessor.cc
(see Foreign2ParameterAccessor for an example)
Example
Motivation
Template Type Argument Requirements (T)
Thrown Exceptions
To Do
- add this feature
- fix this bug
- start discussion of this possible extension
Member Description
Constructor
Destructor
Convert a Glish record to a C++ structure
virtual Bool toRecord(String & error) const
Convert a C++ structure to a Glish Record
Default constructor (not implemented)
using ForeignBaseParameterAccessor<T>::operator()
Interface
- ForeignNSParameterAccessor(const String & name, ParameterSet::Direction direction, GlishRecord * values)
- ~ForeignNSParameterAccessor()
- virtual Bool fromRecord(String & error)
- virtual Bool toRecord(String & error) const
Private Members
- ForeignNSParameterAccessor()
Public Members
- using ForeignBaseParameterAccessor<T>::operator()
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
Etymology
Synopsis
See ForeignParameterAccessor
Example
Motivation
Template Type Argument Requirements (T)
Thrown Exceptions
To Do
- add this feature
- fix this bug
- start discussion of this possible extension
Member Description
Constructor
Destructor
Convert a Glish record to a C++ structure
virtual Bool toRecord(String & error) const
Convert a C++ structure to a Glish Record
Default constructor (not implemented)
using ForeignBaseParameterAccessor<T>::operator()
Interface
Protected Members
- Bool ForeignParameterAccessorScalar(String &error, GlishRecord &rec, const GlishValue &val, const String &name)
- Bool ForeignParameterAccessorScalar(String &error, String &rec, const GlishValue &val, const String &name)
- Bool ForeignParameterAccessorArray(String &error, Bool &shapeExist, IPosition &shape, uInt &nelem, const GlishValue &val, const String &name)
- void ForeignParameterAccessorAddShape(GlishRecord &val, const IPosition &shap)
- void ForeignParameterAccessorAddId(GlishRecord &val, const String &id)
Synopsis
These functions are non-templated, and used in the templated classes.
They are implemented in Foreign1ParameterAccessor.cc
Member Description
Get a scalar record in rec, and test shape. Input name for error
purposes. Input val is a record. If it has a shape defining 1
element, the element is used.
Get the array information of a record (val)
Add the shape attribute
Add the id attribute
Interface
- Bool ForeignFromParameterAccessor(String &error, T &out, const GlishRecord &record)
- Bool ForeignStringParameterAccessor(String &error, T &out, const String &record)
- Bool ForeignToParameterAccessor(String &error, GlishRecord &record, const T &in)
- const String &ForeignIdParameterAccessor(const T &in)
Synopsis
These functions provide the to/from implementations
Specializations are implemented in ForeignNParameterAccessor.h (N > 1)
Member Description
Convert to or from a record; from a String; get ID