SerialHelper.h
Classes
- SerialHelper --
(full description)
Types
- shtBOOL = 0
-
- shtBYTE
-
- shtSHORT
-
- shtINT
-
- shtFLOAT
-
- shtDOUBLE
-
- shtCOMPLEX
-
- shtDCOMPLEX
-
- shtSTRING
-
Interface
- Public Members
- SerialHelper(const Record& record) : gr(record)
- SerialHelper(const SerialHelper& other)
- virtual ~SerialHelper()
- Bool getFuncType(String& ftype) const throw (InvalidSerializationError)
- void checkFuncType(const String& ftype) const throw (InvalidSerializationError)
- Bool exists(const String &name) const
- void get(Bool &val, const String& name, uInt index = 0) const throw (InvalidSerializationError)
- void get(Short &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 val& name, uInt index = 0) const throw (InvalidSerializationError)
- void get(DComplex &val, const val& 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)
- void get(Array<Short> &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 val& name) const throw (InvalidSerializationError)
- void get(Array<DComplex> &val, const val& name) const throw (InvalidSerializationError)
- void get(Array<String> &val, const String& name) const throw (InvalidSerializationError)
- SerialHelper& operator=(const SerialHelper& other)
- Protected Members
- SerialHelper()
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
Etymology
Synopsis
Example
Motivation
Thrown Exceptions
- InvalidSerializationError by getFuncType() if Record
does not contain a "functype" field containing a string.
- InvalidSerializationError
To Do
Member Description
SerialHelper(const SerialHelper& other)
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. 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
void checkFuncType(const String& ftype) const throw (InvalidSerializationError)
ensure that the Function type stored in the given record, gr,
matches ftype. If it does not, an
InvalidSerializationError is thrown.
Bool exists(const String &name) const
return True if a field with the given name exists
void get(Short &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 get(uChar &val, const String& name, uInt index = 0) const
throw (InvalidSerializationError);
void get(Bool &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 val& name, uInt index = 0) const throw (InvalidSerializationError)
void get(DComplex &val, const val& 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)
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 get(Array<Short> &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 get(Array
void get(Array<Bool> &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 val& name) const throw (InvalidSerializationError)
void get(Array<DComplex> &val, const val& name) const throw (InvalidSerializationError)
void get(Array<String> &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.
SerialHelper& operator=(const SerialHelper& other)