casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
casacore::AipsrcVector< T > Class Template Reference

Read multiple values from the Aipsrc resource files. More...

#include <Aipsrc.h>

Inheritance diagram for casacore::AipsrcVector< T >:
casacore::Aipsrc

Public Member Functions

 AipsrcVector ()
 Default constructor See a note in AipsrcValue. More...
 
 ~AipsrcVector ()
 

Static Public Member Functions

static Bool find (Vector< T > &value, const String &keyword)
 The find() functions will, given a keyword, return the value of a matched keyword found in the files. More...
 
static Bool find (Vector< T > &value, const String &keyword, const Vector< T > &deflt)
 
static Bool find (Vector< T > &value, const String &keyword, const Unit &defun, const Unit &resun)
 These find() functions will, given a keyword, read the values of a matched keyword as a Quantity. More...
 
static Bool find (Vector< T > &value, const String &keyword, const Unit &defun, const Unit &resun, const Vector< T > &deflt)
 
static uInt registerRC (const String &keyword, const Vector< T > &deflt)
 Functions to register keywords for later use in get() and set(). More...
 
static uInt registerRC (const String &keyword, const Unit &defun, const Unit &resun, const Vector< T > &deflt)
 
static const Vector< T > & get (uInt keyword)
 Gets are like find, but using registered integers rather than names. More...
 
static void set (uInt keyword, const Vector< T > &deflt)
 Sets allow registered values to be set. More...
 
static void save (uInt keyword)
 Save registered value to $HOME/.aipsrc More...
 
- Static Public Member Functions inherited from casacore::Aipsrc
static Bool find (String &value, const String &keyword)
 
static Bool findNoHome (String &value, const String &keyword)
 
static Bool find (uInt &value, const String &keyword, Int Nname, const String tname[])
 These finds check a (possible) value of the keyword against a list of coded values provided, and return an index into the list (N if not found). More...
 
static Bool find (uInt &value, const String &keyword, const Vector< String > &tname)
 
static Bool find (String &value, const String &keyword, const String &deflt)
 This find usually saves you some lines of code, since you can supply the default you want to use when no such keyword is defined. More...
 
static Bool findNoHome (String &value, const String &keyword, const String &deflt)
 
static Bool find (uInt &value, const String &keyword, Int Nname, const String tname[], const String &deflt)
 
static Bool find (uInt &value, const String &keyword, const Vector< String > &tname, const String &deflt)
 
static Bool findDir (String &foundDir, const String &lastPart="", const Vector< String > &prepends=Vector< String >(), const Vector< String > &appends=Vector< String >(), Bool useStds=True)
 Sets foundDir to the first /firstPart/lastPart path that it finds present on the system, where /firstPart comes from, in order, this list: contents of prepends. More...
 
static uInt registerRC (const String &keyword, const String &deflt)
 Functions to register keywords for later use in get() and set(). More...
 
static uInt registerRC (const String &keyword, Int Nname, const String tname[], const String &deflt)
 
static uInt registerRC (const String &keyword, const Vector< String > &tname, const String &deflt)
 
static const Stringget (uInt keyword)
 Gets are like find, but using registered integers rather than names. More...
 
static const uIntget (uInt &code, uInt keyword)
 get for code More...
 
static void set (uInt keyword, const String &deflt)
 Sets allow registered values to be set. More...
 
static void set (uInt keyword, Int Nname, const String tname[], const String &deflt)
 
static void set (uInt keyword, const Vector< String > &tname, const String &deflt)
 
static void save (uInt keyword)
 Save a registered keyword value to $HOME/.aipsrc More...
 
static void save (uInt keyword, const String tname[])
 
static void save (uInt keyword, const Vector< String > &tname)
 
static void setAipsPath (const String &path=String())
 Set an AIPSPATH that should be used in stead of a global AIPSPATH. More...
 
static const StringaipsRoot ()
 Returns the appropriate Casacore or system variable values. More...
 
static const StringaipsArch ()
 
static const StringaipsSite ()
 
static const StringaipsHost ()
 
static const StringaipsHome ()
 Returns: ~/aips++ More...
 
static void reRead ()
 The reRead() function will reinitialise the static maps and read the aipsrc files again. More...
 
static Double lastRead ()
 
static const Block< String > & values ()
 The following functions return the full lists of available data. More...
 
static const Block< String > & patterns ()
 
static void show (ostream &oStream)
 The following show() function, useful for debugging, outputs all keyword/value pairs found. More...
 
static void show ()
 Prints all info on cout. More...
 
static uInt genRestore (Vector< String > &namlst, Vector< String > &vallst, const String &fileList)
 The following set is a general set of functions. More...
 
static void genSave (Vector< String > &namlst, Vector< String > &vallst, const String &fnam)
 Save the names/values in file. More...
 
static void genSet (Vector< String > &namlst, Vector< String > &vallst, const String &nam, const String &val)
 Set (new or overwrite) keyword/value pair. More...
 
static Bool genUnSet (Vector< String > &namlst, Vector< String > &vallst, const String &nam)
 Remove a keyword from list (False if not in list) More...
 
static Bool genGet (String &val, Vector< String > &namlst, Vector< String > &vallst, const String &nam)
 Get the value of a keyword. More...
 

Private Member Functions

AipsrcVector< T > & operator= (const AipsrcVector< T > &other)
 Copy constructor (not implemented) More...
 
 AipsrcVector (const AipsrcVector< T > &other)
 

Private Attributes

Block< Vector< T > > tlst
 register list More...
 
Block< Stringntlst
 

Static Private Attributes

static AipsrcVector myp_p
 
static std::mutex theirMutex
 

Additional Inherited Members

- Static Protected Member Functions inherited from casacore::Aipsrc
static Bool find (String &value, const String &keyword, uInt start)
 Actual find function. More...
 
static Bool findNoParse (String &value, const String &keyword, uInt start)
 Actual find function to use during parse() without recursing into parse() More...
 
static uInt registerRC (const String &keyword, Block< String > &nlst)
 The registration function. More...
 
static void save (const String keyword, const String val)
 Actual saving. More...
 

Detailed Description

template<class T>
class casacore::AipsrcVector< T >

Read multiple values from the Aipsrc resource files.

Intended use:

Public interface

Review Status

Reviewed By:
mhaller
Date Reviewed:
1997/10/08
Test programs:
tAipsrcValue

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

Example

Motivation

Programs need a way to get multi-valued keywords from the Aipsrc files.

Thrown Exceptions

Definition at line 42 of file Aipsrc.h.

Constructor & Destructor Documentation

template<class T >
casacore::AipsrcVector< T >::AipsrcVector ( )

Default constructor See a note in AipsrcValue.

template<class T >
casacore::AipsrcVector< T >::~AipsrcVector ( )
template<class T >
casacore::AipsrcVector< T >::AipsrcVector ( const AipsrcVector< T > &  other)
private

Member Function Documentation

template<class T >
static Bool casacore::AipsrcVector< T >::find ( Vector< T > &  value,
const String keyword 
)
static

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.

template<class T >
static Bool casacore::AipsrcVector< T >::find ( Vector< T > &  value,
const String keyword,
const Vector< T > &  deflt 
)
static
template<class T >
static Bool casacore::AipsrcVector< T >::find ( Vector< T > &  value,
const String keyword,
const Unit defun,
const Unit resun 
)
static

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

template<class T >
static Bool casacore::AipsrcVector< T >::find ( Vector< T > &  value,
const String keyword,
const Unit defun,
const Unit resun,
const Vector< T > &  deflt 
)
static
template<class T >
static const Vector<T>& casacore::AipsrcVector< T >::get ( uInt  keyword)
static

Gets are like find, but using registered integers rather than names.

template<class T >
AipsrcVector<T>& casacore::AipsrcVector< T >::operator= ( const AipsrcVector< T > &  other)
private

Copy constructor (not implemented)

template<class T >
static uInt casacore::AipsrcVector< T >::registerRC ( const String keyword,
const Vector< T > &  deflt 
)
static

Functions to register keywords for later use in get() and set().

The returned value is the index for get() and set().

template<class T >
static uInt casacore::AipsrcVector< T >::registerRC ( const String keyword,
const Unit defun,
const Unit resun,
const Vector< T > &  deflt 
)
static
template<class T >
static void casacore::AipsrcVector< T >::save ( uInt  keyword)
static

Save registered value to $HOME/.aipsrc

template<class T >
static void casacore::AipsrcVector< T >::set ( uInt  keyword,
const Vector< T > &  deflt 
)
static

Sets allow registered values to be set.

Member Data Documentation

template<class T >
AipsrcVector casacore::AipsrcVector< T >::myp_p
staticprivate

Definition at line 141 of file AipsrcVector.h.

template<class T >
Block<String> casacore::AipsrcVector< T >::ntlst
private

Definition at line 146 of file AipsrcVector.h.

template<class T >
std::mutex casacore::AipsrcVector< T >::theirMutex
staticprivate

Definition at line 142 of file AipsrcVector.h.

template<class T >
Block<Vector<T> > casacore::AipsrcVector< T >::tlst
private

register list

Definition at line 145 of file AipsrcVector.h.


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