Loading...
Searching...
No Matches
casacore::SerialHelper Class Reference
scimath package (libcasa_scimath) » Functionals_module

More...

`#include <SerialHelper.h>`

## 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
| load the function type name as given in the record's "functype" field into the given String ftype.
void | checkFuncType (const String &ftype) const
| 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
| 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
| void get(uChar &val, const String& name, uInt index = 0) const;
void | get (Int &val, const String &name, uInt index=0) const
void | get (Float &val, const String &name, uInt index=0) const
void | get (Double &val, const String &name, uInt index=0) const
void | get (Complex &val, const String &name, uInt index=0) const
void | get (DComplex &val, const String &name, uInt index=0) const
void | get (String &val, const String &name, uInt index=0) const
void | get (Record &val, const String &name) const
void | get (Array< Bool > &val, const String &name) const
| 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
| void get(Array<uChar &val, const String& name) const;
void | get (Array< Int > &val, const String &name) const
void | get (Array< Float > &val, const String &name) const
void | get (Array< Double > &val, const String &name) const
void | get (Array< Complex > &val, const String &name) const
void | get (Array< DComplex > &val, const String &name) const
void | get (Array< String > &val, const String &name) const
SerialHelper & | operator= (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

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Prerequisite

- FunctionFactory

### Etymology

### Synopsis

### Example

### Motivation

### Thrown Exceptions

- InvalidSerializationError by getFuncType() if Record does not contain a "functype" field containing a string.
- InvalidSerializationError

### To Do

Definition at line 97 of file SerialHelper.h.

## Member Enumeration Documentation

## shType

enum casacore::SerialHelper::shType

Enumerator
shtBOOL |
shtBYTE |
shtSHORT |
shtINT |
shtFLOAT |
shtDOUBLE |
shtCOMPLEX |
shtDCOMPLEX |
shtSTRING |

Definition at line 101 of file SerialHelper.h.

## Constructor & Destructor Documentation

## SerialHelper() [1/3]

casacore::SerialHelper::SerialHelper | ( | const Record & | record | ) |

inline

Definition at line 104 of file SerialHelper.h.

References gr, and casacore::Record().

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

## SerialHelper() [2/3]

casacore::SerialHelper::SerialHelper | ( | const SerialHelper & | other | ) |

inline

Definition at line 105 of file SerialHelper.h.

References gr, and SerialHelper().

## ~SerialHelper()

virtual casacore::SerialHelper::~SerialHelper | ( |  | ) |

inline virtual

Definition at line 106 of file SerialHelper.h.

## SerialHelper() [3/3]

casacore::SerialHelper::SerialHelper | ( |  | ) |

inline protected

Definition at line 181 of file SerialHelper.h.

## Member Function Documentation

## checkFuncType()

void casacore::SerialHelper::checkFuncType | ( | const String & | ftype | ) | const

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

If it does not, an InvalidSerializationError is thrown.

## exists()

Bool casacore::SerialHelper::exists | ( | const String & | name | ) | const

inline

return True if a field with the given name exists

Definition at line 124 of file SerialHelper.h.

References gr, and casacore::name().

## get() [1/17]

void casacore::SerialHelper::get | ( | Array< Bool > & | val,
|  | const String & | name ) const

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.

References casacore::name().

## get() [2/17]

void casacore::SerialHelper::get | ( | Array< Complex > & | val,
|  | const String & | name ) const

References casacore::name().

## get() [3/17]

void casacore::SerialHelper::get | ( | Array< DComplex > & | val,
|  | const String & | name ) const

References casacore::name().

## get() [4/17]

void casacore::SerialHelper::get | ( | Array< Double > & | val,
|  | const String & | name ) const

References casacore::name().

## get() [5/17]

void casacore::SerialHelper::get | ( | Array< Float > & | val,
|  | const String & | name ) const

References casacore::name().

## get() [6/17]

void casacore::SerialHelper::get | ( | Array< Int > & | val,
|  | const String & | name ) const

References casacore::name().

## get() [7/17]

void casacore::SerialHelper::get | ( | Array< Short > & | val,
|  | const String & | name ) const

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

References casacore::name().

## get() [8/17]

void casacore::SerialHelper::get | ( | Array< String > & | val,
|  | const String & | name ) const

References casacore::name().

## get() [9/17]

void casacore::SerialHelper::get | ( | Bool & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

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.

References casacore::name().

## get() [10/17]

void casacore::SerialHelper::get | ( | Complex & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

References casacore::name().

## get() [11/17]

void casacore::SerialHelper::get | ( | DComplex & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

References casacore::name().

## get() [12/17]

void casacore::SerialHelper::get | ( | Double & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

References casacore::name().

## get() [13/17]

void casacore::SerialHelper::get | ( | Float & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

References casacore::name().

## get() [14/17]

void casacore::SerialHelper::get | ( | Int & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

References casacore::name().

## get() [15/17]

void casacore::SerialHelper::get | ( | Record & | val,
|  | const String & | name ) const

References casacore::name(), and casacore::Record().

## get() [16/17]

void casacore::SerialHelper::get | ( | Short & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

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

References casacore::name().

## get() [17/17]

void casacore::SerialHelper::get | ( | String & | val,
|  | const String & | name,
|  | uInt | index = 0 ) const

References casacore::name().

## getFuncType()

Bool casacore::SerialHelper::getFuncType | ( | String & | ftype | ) | const

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

- InvalidSerializationError if "functype" exists but is empty or the incorrect type

## operator=()

SerialHelper & casacore::SerialHelper::operator= | ( | const SerialHelper & | other | ) |

inline

Definition at line 175 of file SerialHelper.h.

References gr, and SerialHelper().

## Member Data Documentation

## FUNCTYPE

const String casacore::SerialHelper::FUNCTYPE

static

Definition at line 99 of file SerialHelper.h.

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

## gr

Record casacore::SerialHelper::gr

private

Definition at line 185 of file SerialHelper.h.

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

## gtype

const String casacore::SerialHelper::gtype[]

static

Definition at line 100 of file SerialHelper.h.

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

- scimath/Functionals/SerialHelper.h