ForeignParameterAccessor.h

Classes

ForeignBaseParameterAccessor -- Base class to access Glish data structures (full description)
ForeignParameterAccessor -- Class to access foreign Glish data structures (full description)
ForeignNSParameterAccessor -- Class to access non-standard foreign Glish data structures (full description)
Global Functions -- Global non-templated functions (full description)
Global Functions -- Global templated interface (full description)

template<class T> class ForeignBaseParameterAccessor : public ParameterAccessor<T>

Interface

Public Members
typedef Bool (*PACFR)(String &, T &, const GlishRecord &)
typedef Bool (*PACST)(String &, T &, const String &)
typedef Bool (*PACTO)(String &, PACTO &, const T &)
typedef Bool (T::*FRGR)(String &, const RecordInterface &)
typedef Bool (T::*FRST)(String &, const String &)
typedef Bool (T::*TOGR)(String &, RecordInterface &) const
ForeignBaseParameterAccessor(const String & name, ParameterSet::Direction direction, GlishRecord * values)
~ForeignBaseParameterAccessor()
Bool fromRecord(String & error, PACFR from, PACST frst, FRGR fromGR, FRST fromST)
Bool toRecord(String & error, PACTO to, TOGR toGR, ID idfr, IDGR idGR) const
Private Members
ForeignBaseParameterAccessor()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

See ForeignParameterAccessor

Example

Motivation

Template Type Argument Requirements (T)

Thrown Exceptions

To Do

Member Description

typedef Bool (*PACFR)(String &, T &, const GlishRecord &)
typedef Bool (*PACST)(String &, T &, const String &)
typedef Bool (*PACTO)(String &, PACTO &, const T &)
typedef Bool (T::*FRGR)(String &, const RecordInterface &)
typedef Bool (T::*FRST)(String &, const String &)
typedef Bool (T::*TOGR)(String &, RecordInterface &) const

ForeignBaseParameterAccessor(const String & name, ParameterSet::Direction direction, GlishRecord * values)

Constructor

~ForeignBaseParameterAccessor()

Destructor

Bool fromRecord(String & error, PACFR from, PACST frst, FRGR fromGR, FRST fromST)

Convert a Glish record to a C++ structure

Bool toRecord(String & error, PACTO to, TOGR toGR, ID idfr, IDGR idGR) const

Convert a C++ structure to a Glish Record

ForeignBaseParameterAccessor()

Default constructor (not implemented)

template<class T> class ForeignParameterAccessor : public ForeignBaseParameterAccessor<T>

Interface

Public Members
ForeignParameterAccessor(const String & name, ParameterSet::Direction direction, GlishRecord * values)
~ForeignParameterAccessor()
virtual Bool fromRecord(String & error)
virtual Bool toRecord(String & error) const
Private Members
ForeignParameterAccessor()

Description

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:

Example

Motivation

Template Type Argument Requirements (T)

Thrown Exceptions

To Do

Member Description

ForeignParameterAccessor(const String & name, ParameterSet::Direction direction, GlishRecord * values)

Constructor

~ForeignParameterAccessor()

Destructor

virtual Bool fromRecord(String & error)

Convert a Glish record to a C++ structure

virtual Bool toRecord(String & error) const

Convert a C++ structure to a Glish Record

ForeignParameterAccessor()

Default constructor (not implemented)

template<class T> class ForeignNSParameterAccessor : public ForeignBaseParameterAccessor<T>

Interface

Public Members
ForeignNSParameterAccessor(const String & name, ParameterSet::Direction direction, GlishRecord * values)
~ForeignNSParameterAccessor()
virtual Bool fromRecord(String & error)
virtual Bool toRecord(String & error) const
Private Members
ForeignNSParameterAccessor()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

See ForeignParameterAccessor

Example

Motivation

Template Type Argument Requirements (T)

Thrown Exceptions

To Do

Member Description

ForeignNSParameterAccessor(const String & name, ParameterSet::Direction direction, GlishRecord * values)

Constructor

~ForeignNSParameterAccessor()

Destructor

virtual Bool fromRecord(String & error)

Convert a Glish record to a C++ structure

virtual Bool toRecord(String & error) const

Convert a C++ structure to a Glish Record

ForeignNSParameterAccessor()

Default constructor (not implemented)

Global non-templated functions (source)

Interface

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)

Description

Synopsis

These functions are non-templated, and used in the templated classes. They are implemented in Foreign1ParameterAccessor.cc

Member Description

Bool ForeignParameterAccessorScalar(String &error, GlishRecord &rec, const GlishValue &val, const String &name)
Bool ForeignParameterAccessorScalar(String &error, String &rec, const GlishValue &val, const String &name)

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.

Bool ForeignParameterAccessorArray(String &error, Bool &shapeExist, IPosition &shape, uInt &nelem, const GlishValue &val, const String &name)

Get the array information of a record (val)

void ForeignParameterAccessorAddShape(GlishRecord &val, const IPosition &shap)

Add the shape attribute

void ForeignParameterAccessorAddId(GlishRecord &val, const String &id)

Add the id attribute

Global templated interface (source)

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)

Description

Synopsis

These functions provide the to/from implementations Specializations are implemented in ForeignNParameterAccessor.h (N > 1)

Member Description

Bool ForeignFromParameterAccessor(String &error, T &out, const GlishRecord &record)

Convert to or from a record; from a String; get ID

Bool ForeignStringParameterAccessor(String &error, T &out, const String &record)

Bool ForeignToParameterAccessor(String &error, GlishRecord &record, const T &in)

const String &ForeignIdParameterAccessor(const T &in)