GlishSerialHelper.h
Classes
- GlishSerialHelper --
(full description)
Interface
- Public Members
- GlishSerialHelper(const GlishRecord& record) : gr(record)
- GlishSerialHelper(const GlishSerialHelper& other)
- virtual ~GlishSerialHelper()
- Bool getFuncType(String& ftype) const throw (InvalidGlishSerializationError)
- void checkFuncType(const String& ftype) const throw (InvalidGlishSerializationError)
- Bool exists(const String &name) const
- void get(Bool &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(Short &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(Int &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(Float &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(Double &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(Complex &val, const val& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(DComplex &val, const val& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(String &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
- void get(GlishRecord &val, const String& name) const throw (InvalidGlishSerializationError)
- void get(Array<Bool> &val, const String& name) const throw (InvalidGlishSerializationError)
- void get(Array<Short> &val, const String& name) const throw (InvalidGlishSerializationError)
- void get(Array<Int> &val, const String& name) const throw (InvalidGlishSerializationError)
- void get(Array<Float> &val, const String& name) const throw (InvalidGlishSerializationError)
- void get(Array<Double> &val, const String& name) const throw (InvalidGlishSerializationError)
- void get(Array<Complex> &val, const val& name) const throw (InvalidGlishSerializationError)
- void get(Array<DComplex> &val, const val& name) const throw (InvalidGlishSerializationError)
- void get(Array<String> &val, const String& name) const throw (InvalidGlishSerializationError)
- GlishSerialHelper& operator=(const GlishSerialHelper& other)
- Protected Members
- GlishSerialHelper()
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
Etymology
Synopsis
Example
Motivation
Thrown Exceptions
- InvalidGlishSerializationError by getFuncType() if GlishRecord
does not contain a "functype" field containing a string.
- InvalidGlishSerializationError
To Do
Member Description
Bool getFuncType(String& ftype) const throw (InvalidGlishSerializationError)
load the function type name as given in the record's "functype"
field into the given String ftype. gr is the
Glish record to extract from. False is returned if the record
does not contain this field.
Thrown Exceptions
- InvalidGlishSerializationError if "functype" exists but is
empty or the incorrect type
void checkFuncType(const String& ftype) const throw (InvalidGlishSerializationError)
ensure that the Function type stored in the given record, gr,
matches ftype. If it does not, an
InvalidGlishSerializationError 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 (InvalidGlishSerializationError)
Get the indexth element of the name field
This should be
particularly useful for GlishArray objects with only one element,
i.e. a scalar.
Note that unlike the native Glish classes, indexing is zero-relative.
InvalidGlishSerializationError 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 (InvalidGlishSerializationError);
void get(Bool &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
void get(Int &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
void get(Float &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
void get(Double &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
void get(Complex &val, const val& name, uInt index = 0) const throw (InvalidGlishSerializationError)
void get(DComplex &val, const val& name, uInt index = 0) const throw (InvalidGlishSerializationError)
void get(String &val, const String& name, uInt index = 0) const throw (InvalidGlishSerializationError)
void get(GlishRecord &val, const String& name) const throw (InvalidGlishSerializationError)
Get the indexth element of the name field
This should be
particularly useful for GlishArray objects with only one element,
i.e. a scalar.
Note that unlike the native Glish classes, indexing is zero-relative.
InvalidGlishSerializationError 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 (InvalidGlishSerializationError)
Get the indexth element of the name field
This should be
particularly useful for GlishArray objects with only one element,
i.e. a scalar.
Note that unlike the native Glish classes, indexing is zero-relative.
InvalidGlishSerializationError 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 (InvalidGlishSerializationError)
void get(Array<Int> &val, const String& name) const throw (InvalidGlishSerializationError)
void get(Array<Float> &val, const String& name) const throw (InvalidGlishSerializationError)
void get(Array<Double> &val, const String& name) const throw (InvalidGlishSerializationError)
void get(Array<Complex> &val, const val& name) const throw (InvalidGlishSerializationError)
void get(Array<DComplex> &val, const val& name) const throw (InvalidGlishSerializationError)
void get(Array<String> &val, const String& name) const throw (InvalidGlishSerializationError)
Get the indexth element of the name field
This should be
particularly useful for GlishArray objects with only one element,
i.e. a scalar.
Note that unlike the native Glish classes, indexing is zero-relative.
InvalidGlishSerializationError 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.
GlishSerialHelper& operator=(const GlishSerialHelper& other)