casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes
casa::SerialHelper Class Reference

#include <SerialHelper.h>

List of all members.

Public Types

enum  shType {
  shtBOOL,
  shtBYTE,
  shtSHORT,
  shtINT,
  shtFLOAT,
  shtDOUBLE,
  shtCOMPLEX,
  shtDCOMPLEX,
  shtSTRING
}

Public Member Functions

 SerialHelper (const Record &record)
 SerialHelper (const SerialHelper &other)
virtual ~SerialHelper ()
Bool getFuncType (String &ftype) const throw (InvalidSerializationError)
 load the function type name as given in the record's "functype" field into the given String ftype.
void checkFuncType (const String &ftype) const throw (InvalidSerializationError)
 ensure that the Function type stored in the given record, gr, matches ftype.
Bool exists (const String &name) const
 return True if a field with the given name exists
void get (Bool &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
 Get the indexth element of the name field This should be particularly useful for Array objects with only one element, i.e.
void get (Short &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
 void get(uChar &val, const String& name, uInt index = 0) const throw (InvalidSerializationError);
void get (Int &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
void get (Float &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
void get (Double &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
void get (Complex &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
void get (DComplex &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
void get (String &val, const String &name, uInt index=0) const throw (InvalidSerializationError)
void get (Record &val, const String &name) const throw (InvalidSerializationError)
void get (Array< Bool > &val, const String &name) const throw (InvalidSerializationError)
 Get the indexth element of the name field This should be particularly useful for Array objects with only one element, i.e.
void get (Array< Short > &val, const String &name) const throw (InvalidSerializationError)
 void get(Array<uChar &val, const String& name) const throw (InvalidSerializationError);
void get (Array< Int > &val, const String &name) const throw (InvalidSerializationError)
void get (Array< Float > &val, const String &name) const throw (InvalidSerializationError)
void get (Array< Double > &val, const String &name) const throw (InvalidSerializationError)
void get (Array< Complex > &val, const String &name) const throw (InvalidSerializationError)
void get (Array< DComplex > &val, const String &name) const throw (InvalidSerializationError)
void get (Array< String > &val, const String &name) const throw (InvalidSerializationError)
SerialHelperoperator= (const SerialHelper &other)
 
     

Static Public Attributes

static const String FUNCTYPE
static const String gtype []

Protected Member Functions

 SerialHelper ()

Private Attributes

Record gr

Detailed Description

Intended use:

Public interface

 <h3>Review Status</h3><dl><dt>Date Reviewed:<dd>yyyy/mm/dd</dl> 

Prerequisite

Etymology

Synopsis

Example

Motivation

Thrown Exceptions

To Do

Definition at line 101 of file SerialHelper.h.


Member Enumeration Documentation

Enumerator:
shtBOOL 
shtBYTE 
shtSHORT 
shtINT 
shtFLOAT 
shtDOUBLE 
shtCOMPLEX 
shtDCOMPLEX 
shtSTRING 

Definition at line 105 of file SerialHelper.h.


Constructor & Destructor Documentation

casa::SerialHelper::SerialHelper ( const Record record) [inline]

Definition at line 108 of file SerialHelper.h.

casa::SerialHelper::SerialHelper ( const SerialHelper other) [inline]

Definition at line 109 of file SerialHelper.h.

References gr.

virtual casa::SerialHelper::~SerialHelper ( ) [inline, virtual]

Definition at line 110 of file SerialHelper.h.

casa::SerialHelper::SerialHelper ( ) [inline, protected]

Definition at line 206 of file SerialHelper.h.


Member Function Documentation

ensure that the Function type stored in the given record, gr, matches ftype.

If it does not, an InvalidSerializationError is thrown.

Bool casa::SerialHelper::exists ( const String name) const [inline]

return True if a field with the given name exists

Definition at line 130 of file SerialHelper.h.

void casa::SerialHelper::get ( Bool val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)

Get the indexth element of the name field This should be particularly useful for Array objects with only one element, i.e.

a scalar. Note that unlike the native classes, indexing is zero-relative.

InvalidSerializationError is thrown if:

  • if the given record does not contain a field called name
  • if the field is not a vector of the correct type.
  • if the index is out of range.
void casa::SerialHelper::get ( Short val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)

void get(uChar &val, const String& name, uInt index = 0) const throw (InvalidSerializationError);

void casa::SerialHelper::get ( Int val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Float val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Double val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Complex &  val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( DComplex &  val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( String val,
const String name,
uInt  index = 0 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Record val,
const String name 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Array< Bool > &  val,
const String name 
) const throw (InvalidSerializationError)

Get the indexth element of the name field This should be particularly useful for Array objects with only one element, i.e.

a scalar. Note that unlike the native classes, indexing is zero-relative.

InvalidSerializationError is thrown if:

  • if the given record does not contain a field called name
  • if the field is not a vector of the correct type.
  • if the index is out of range.
void casa::SerialHelper::get ( Array< Short > &  val,
const String name 
) const throw (InvalidSerializationError)

void get(Array<uChar &val, const String& name) const throw (InvalidSerializationError);

void casa::SerialHelper::get ( Array< Int > &  val,
const String name 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Array< Float > &  val,
const String name 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Array< Double > &  val,
const String name 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Array< Complex > &  val,
const String name 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Array< DComplex > &  val,
const String name 
) const throw (InvalidSerializationError)
void casa::SerialHelper::get ( Array< String > &  val,
const String name 
) const throw (InvalidSerializationError)

load the function type name as given in the record's "functype" field into the given String ftype.

gr is the record to extract from. False is returned if the record does not contain this field.

Thrown Exceptions

SerialHelper& casa::SerialHelper::operator= ( const SerialHelper other) [inline]

     

Definition at line 200 of file SerialHelper.h.

References gr.


Member Data Documentation

Definition at line 103 of file SerialHelper.h.

Referenced by casa::FunctionMarshallable::loadFuncType().

Definition at line 210 of file SerialHelper.h.

Referenced by operator=(), and SerialHelper().

Definition at line 104 of file SerialHelper.h.


The documentation for this class was generated from the following file: