AipsrcVector.h
Classes
- AipsrcVector -- Read multiple values from the Aipsrc resource files (full description)
- AipsrcVector_String -- Specialization of AipsrcVector for String (full description)
- AipsrcVector_Bool -- Specialization of AipsrcVector for Bool (full description)
Interface
- Public Members
- AipsrcVector()
- ~AipsrcVector()
- static Bool find(Vector<T> &value, const String &keyword)
- static Bool find(Vector<T> &value, const String &keyword, const Vector<T> &deflt)
- static Bool find(Vector<T> &value, const String &keyword, const String &defun, const String &resun)
- static Bool find(Vector<T> &value, const String &keyword, const String &defun, const String &resun, const Vector<T> &deflt)
- static uInt registerRC(const String &keyword, const Vector<T> &deflt)
- static uInt registerRC(const String &keyword, const Unit &defun, const Unit &resun, const Vector<T> &deflt)
- static const Vector<T> &get(uInt keyword)
- static void set(uInt keyword, const Vector<T> &deflt)
- static void save(uInt keyword)
- Private Members
- AipsrcVector<T> &operator=(const AipsrcVector<T> &other)
- AipsrcVector(const AipsrcVector<T> &other)
Review Status
- Reviewed By:
- mhaller
- Date Reviewed:
- 1997/10/08
- Programs:
- Tests:
Prerequisite
Etymology
A class for getting multiple values from the Aipsrc files
Synopsis
The available functions (and notes) are the same as in
AipsrcValue, but with a Vector result.
Template Type Argument Requirements
- All types with a >> defined.
Since interpretation of the keyword value string is done with the standard
input right-shift operator, specialisations are necessary for non-standard
cases like Bool and String. They are provided.
Example
Motivation
Programs need a way to get multi-valued keywords from the Aipsrc files.
Thrown Exceptions
- AipsError if the environment variables HOME and/or AIPSPATH not set.
To Do
Member Description
Default constructor
See a note in AipsrcValue.
static Bool find(Vector<T> &value, const String &keyword)
static Bool find(Vector<T> &value, const String &keyword, const Vector<T> &deflt)
The find() functions will, given a keyword, return the value
of a matched keyword found in the files. If no match found the
function will be False, and the default returned if specified.
static Bool find(Vector<T> &value, const String &keyword, const String &defun, const String &resun)
static Bool find(Vector<T> &value, const String &keyword, const String &defun, const String &resun, const Vector<T> &deflt)
These find() functions will, given a keyword, read the values
of a matched keyword as a Quantity. If no unit has been given in the
keyword value, the defun Unit will be assumed. The value returned
will be converted to the resun Unit. If no match found, the default
value is returned (see example above).
static uInt registerRC(const String &keyword, const Vector<T> &deflt)
static uInt registerRC(const String &keyword, const Unit &defun, const Unit &resun, const Vector<T> &deflt)
Functions to register keywords for later use in get() and set(). The
returned value is the index for get() and set().
static const Vector<T> &get(uInt keyword)
Gets are like find, but using registered integers rather than names.
static void set(uInt keyword, const Vector<T> &deflt)
Sets allow registered values to be set
static void save(uInt keyword)
Save registered value to $HOME/.aipsrc
AipsrcVector<T> &operator=(const AipsrcVector<T> &other)
Copy constructor (not implemented)
AipsrcVector(const AipsrcVector<T> &other)
Interface
Public Members
- AipsrcVector_String()
- ~AipsrcVector_String()
- static Bool find(Vector<String> &value, const String &keyword)
- static Bool find(Vector<String> &value, const String &keyword, const Vector<String> &deflt)
- static uInt registerRC(const String &keyword, const Vector<String> &deflt)
- static const Vector<String> &get(uInt keyword)
- static void set(uInt keyword, const Vector<String> &deflt)
- static void save(uInt keyword)
Private Members
- AipsrcVector_String<String> &operator=(const AipsrcVector_String<String> &other)
- AipsrcVector_String(const AipsrcVector_String<String> &other)
Synopsis
The name AipsrcVector_String is only for cxx2html
documentation problems. Use AipsrcVector in your code.
Member Description
static const Vector<String> &get(uInt keyword)
static void set(uInt keyword, const Vector<String> &deflt)
static void save(uInt keyword)
AipsrcVector_String<String> &operator=(const AipsrcVector_String<String> &other)
Interface
Public Members
- AipsrcVector_Bool()
- ~AipsrcVector_Bool()
- static Bool find(Vector<Bool> &value, const String &keyword)
- static Bool find(Vector<Bool> &value, const String &keyword, const Vector<Bool> &deflt)
- static uInt registerRC(const String &keyword, const Vector<Bool> &deflt)
- static const Vector<Bool> &get(uInt keyword)
- static void set(uInt keyword, const Vector<Bool> &deflt)
- static void save(uInt keyword)
Private Members
- AipsrcVector_Bool<Bool> &operator=(const AipsrcVector_Bool<Bool> &other)
- AipsrcVector_Bool(const AipsrcVector_Bool<Bool> &other)
Synopsis
The name AipsrcVector_Bool is only for cxx2html
documentation problems. Use AipsrcVector in your code.
Member Description
static Bool find(Vector<Bool> &value, const String &keyword)
static Bool find(Vector<Bool> &value, const String &keyword, const Vector<Bool> &deflt)
static uInt registerRC(const String &keyword, const Vector<Bool> &deflt)
static const Vector<Bool> &get(uInt keyword)
static void set(uInt keyword, const Vector<Bool> &deflt)
static void save(uInt keyword)
AipsrcVector_Bool<Bool> &operator=(const AipsrcVector_Bool<Bool> &other)
AipsrcVector_Bool(const AipsrcVector_Bool<Bool> &other)