casacore
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
casacore::SerialHelper Class Reference

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. 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

◆ shType

Enumerator
shtBOOL 
shtBYTE 
shtSHORT 
shtINT 
shtFLOAT 
shtDOUBLE 
shtCOMPLEX 
shtDCOMPLEX 
shtSTRING 

Definition at line 104 of file SerialHelper.h.

Constructor & Destructor Documentation

◆ SerialHelper() [1/3]

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

Definition at line 107 of file SerialHelper.h.

◆ SerialHelper() [2/3]

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

Definition at line 108 of file SerialHelper.h.

References gr.

◆ ~SerialHelper()

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

Definition at line 109 of file SerialHelper.h.

◆ SerialHelper() [3/3]

casacore::SerialHelper::SerialHelper ( )
inlineprotected

Definition at line 184 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 127 of file SerialHelper.h.

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

◆ 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.

◆ get() [2/17]

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

◆ get() [3/17]

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

◆ get() [4/17]

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

◆ get() [5/17]

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

◆ get() [6/17]

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

◆ get() [7/17]

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

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

◆ get() [8/17]

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

◆ 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.

◆ get() [10/17]

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

◆ get() [11/17]

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

◆ get() [12/17]

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

◆ get() [13/17]

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

◆ get() [14/17]

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

◆ get() [15/17]

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

◆ 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;

◆ get() [17/17]

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

◆ 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

◆ operator=()

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

Definition at line 178 of file SerialHelper.h.

References gr.

Member Data Documentation

◆ FUNCTYPE

const String casacore::SerialHelper::FUNCTYPE
static

Definition at line 102 of file SerialHelper.h.

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

◆ gr

Record casacore::SerialHelper::gr
private

Definition at line 188 of file SerialHelper.h.

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

◆ gtype

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: