casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
casacore::SerialHelper Class Reference

#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. More...
 
void checkFuncType (const String &ftype) const
 ensure that the Function type stored in the given record, gr, matches ftype. More...
 
Bool exists (const String &name) const
 return True if a field with the given name exists More...
 
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. More...
 
void get (Short &val, const String &name, uInt index=0) const
 void get(uChar &val, const String& name, uInt index = 0) const; More...
 
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. More...
 
void get (Array< Short > &val, const String &name) const
 void get(Array<uChar &val, const String& name) const; More...
 
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
 
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

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

Example

Motivation

Thrown Exceptions

To Do

Definition at line 100 of file SerialHelper.h.

Member Enumeration Documentation

Enumerator
shtBOOL 
shtBYTE 
shtSHORT 
shtINT 
shtFLOAT 
shtDOUBLE 
shtCOMPLEX 
shtDCOMPLEX 
shtSTRING 

Definition at line 104 of file SerialHelper.h.

Constructor & Destructor Documentation

casacore::SerialHelper::SerialHelper ( const Record record)
inline

Definition at line 107 of file SerialHelper.h.

casacore::SerialHelper::SerialHelper ( const SerialHelper other)
inline

Definition at line 108 of file SerialHelper.h.

References gr.

virtual casacore::SerialHelper::~SerialHelper ( )
inlinevirtual

Definition at line 109 of file SerialHelper.h.

casacore::SerialHelper::SerialHelper ( )
inlineprotected

Definition at line 184 of file SerialHelper.h.

Member Function Documentation

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.

Bool casacore::SerialHelper::exists ( const String name) const
inline

return True if a field with the given name exists

Definition at line 127 of file SerialHelper.h.

References gr, and casacore::RecordInterface::isDefined().

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.
void casacore::SerialHelper::get ( Short val,
const String name,
uInt  index = 0 
) const

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

void casacore::SerialHelper::get ( Int val,
const String name,
uInt  index = 0 
) const
void casacore::SerialHelper::get ( Float val,
const String name,
uInt  index = 0 
) const
void casacore::SerialHelper::get ( Double val,
const String name,
uInt  index = 0 
) const
void casacore::SerialHelper::get ( Complex &  val,
const String name,
uInt  index = 0 
) const
void casacore::SerialHelper::get ( DComplex &  val,
const String name,
uInt  index = 0 
) const
void casacore::SerialHelper::get ( String val,
const String name,
uInt  index = 0 
) const
void casacore::SerialHelper::get ( Record val,
const String name 
) const
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.
void casacore::SerialHelper::get ( Array< Short > &  val,
const String name 
) const

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

void casacore::SerialHelper::get ( Array< Int > &  val,
const String name 
) const
void casacore::SerialHelper::get ( Array< Float > &  val,
const String name 
) const
void casacore::SerialHelper::get ( Array< Double > &  val,
const String name 
) const
void casacore::SerialHelper::get ( Array< Complex > &  val,
const String name 
) const
void casacore::SerialHelper::get ( Array< DComplex > &  val,
const String name 
) const
void casacore::SerialHelper::get ( Array< String > &  val,
const String name 
) const
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

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

Definition at line 178 of file SerialHelper.h.

References gr.

Member Data Documentation

const String casacore::SerialHelper::FUNCTYPE
static

Definition at line 102 of file SerialHelper.h.

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

Record casacore::SerialHelper::gr
private

Definition at line 188 of file SerialHelper.h.

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

const String casacore::SerialHelper::gtype[]
static

Definition at line 103 of file SerialHelper.h.


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