casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
casa::DParameterString Class Reference

Implementation of DisplayParameter to store casacore::String parameters. More...

#include <DParameterString.h>

Inheritance diagram for casa::DParameterString:
casa::DisplayParameter

Public Member Functions

 DParameterString (const casacore::String name, const casacore::String description, const casacore::String help, const casacore::String defaultvalue, const casacore::String value, const casacore::String context="", const casacore::Bool editable=true)
 Constructor taking the name of the parameter, a short description, some help text, a default value, an initial value, and flags indicating whether the parameter can be unset and is editable. More...
 
 DParameterString (const DParameterString &other)
 (Required) copy constructor. More...
 
virtual ~DParameterString ()
 Destructor. More...
 
DParameterStringoperator= (const DParameterString &other)
 (Required) copy assignment. More...
 
virtual casacore::Bool fromRecord (const casacore::RecordInterface &record)
 Parse record, and update this parameter if a field exists whose name matches that of this parameter. More...
 
virtual void toRecord (casacore::RecordInterface &record, const casacore::Bool fullrecord=true, const casacore::Bool overwrite=false)
 Place a record describing this parameter in a sub-field of record with name matching that of this parameter. More...
 
casacore::String defaultValue ()
 Return the default for this parameter. More...
 
casacore::String value ()
 Return the current value of this parameter. More...
 
- Public Member Functions inherited from casa::DisplayParameter
virtual ~DisplayParameter ()
 Destructor. More...
 
casacore::String name () const
 Return the name of this parameter. More...
 
casacore::String description () const
 Return the description of this parameter. More...
 
casacore::String help () const
 Return the help for this parameter. More...
 
casacore::String context () const
 Return the context of this parameter. More...
 
casacore::Bool allowUnset () const
 Return whether this parameter can be unset. More...
 
casacore::Bool editable () const
 Return whether this parameter is editable. More...
 
void setName (const casacore::String name)
 Set or change the name of this parameter to that specified. More...
 
void setDescription (const casacore::String description)
 Set or change the description of this parameter to what is specified. More...
 
void setHelp (const casacore::String help)
 Set or change the help for this parameter to what is specified. More...
 
void setContext (const casacore::String context)
 Set or change the context of this parameter to what is specified. More...
 
void setAllowUnset (const casacore::Bool allowunset)
 Set or change whether this parameter may be unset, according to the function argument value. More...
 
void setEditable (const casacore::Bool editable)
 Set or change whether this parameter is editable according to the function argument. More...
 

Protected Member Functions

 DParameterString ()
 (Required) default constructor. More...
 
- Protected Member Functions inherited from casa::DisplayParameter
 DisplayParameter (const casacore::String name, const casacore::String description, const casacore::String help, const casacore::String context="", const casacore::Bool allowunset=false, const casacore::Bool editable=true)
 Constructor taking the name of the parameter, a short description, some help text, and flags indicating whether the parameter can be unset and is editable. More...
 
 DisplayParameter (const DisplayParameter &other)
 Copy constructor using copy semantics. More...
 
 DisplayParameter ()
 Default constructor yielding a useless DisplayParameter. More...
 
DisplayParameteroperator= (const DisplayParameter &other)
 Copy assignment. More...
 
casacore::Record baseDescription ()
 Return a basic description of this parameter; used by virtual implementations of toRecord method to fill out a casacore::Record describing this DisplayParameter. More...
 
const DisplayOptionsdisplayOptions () const
 Return the DisplayOptions to use for parsing Records. More...
 

Private Attributes

casacore::String itsDefault
 Store for the default of this parameter. More...
 
casacore::String itsValue
 Store for the value of this parameter. More...
 

Detailed Description

Implementation of DisplayParameter to store casacore::String parameters.

Intended use:

Public interface

Prerequisite

Etymology

DParameterString is an implementation of a DisplayParameter providing a casacore::String parameter type.

Synopsis

This class is derived from DisplayParameter and provides a casacore::String-type parameter. casacore::String parameters simply have a String value, and a default casacore::String value. They cannot be unset.

Example

A DParameterString can easily be used to store and update any parameter which can be expressed as a String. In the following example, a DParameterString is constructed to store some text to be used for axis labelling:

DParameterString pstring("xaxislabel", "X Axis Label",
"Enter the text to appear alongside the X Axis");
//..\.
// update the parameter from some Record
pstring.fromRecord(rec);
// examine the value of the parameter
if (pstring.value() == "Four frogs found fabulous frocks") {
//..\.
}

Motivation

Many parameters are naturally Strings, or can be expressed as Strings, hence this class.

Thrown Exceptions

To Do

Definition at line 96 of file DParameterString.h.

Constructor & Destructor Documentation

casa::DParameterString::DParameterString ( const casacore::String  name,
const casacore::String  description,
const casacore::String  help,
const casacore::String  defaultvalue,
const casacore::String  value,
const casacore::String  context = "",
const casacore::Bool  editable = true 
)

Constructor taking the name of the parameter, a short description, some help text, a default value, an initial value, and flags indicating whether the parameter can be unset and is editable.

casa::DParameterString::DParameterString ( const DParameterString other)

(Required) copy constructor.

virtual casa::DParameterString::~DParameterString ( )
virtual

Destructor.

casa::DParameterString::DParameterString ( )
protected

(Required) default constructor.

Member Function Documentation

casacore::String casa::DParameterString::defaultValue ( )
inline

Return the default for this parameter.

Definition at line 135 of file DParameterString.h.

References itsDefault.

virtual casacore::Bool casa::DParameterString::fromRecord ( const casacore::RecordInterface record)
virtual

Parse record, and update this parameter if a field exists whose name matches that of this parameter.

Return true if the parameter is changed, otherwise return false.

Implements casa::DisplayParameter.

DParameterString& casa::DParameterString::operator= ( const DParameterString other)

(Required) copy assignment.

virtual void casa::DParameterString::toRecord ( casacore::RecordInterface record,
const casacore::Bool  fullrecord = true,
const casacore::Bool  overwrite = false 
)
virtual

Place a record describing this parameter in a sub-field of record with name matching that of this parameter.

If overwrite is true, then any existing field with matching name will be overwritten. If fullrecord is true, then a complete description of the parameter is given, otherwise just its current value is stored in record. Presently fullrecord is ignored.

Implements casa::DisplayParameter.

casacore::String casa::DParameterString::value ( void  )
inline

Return the current value of this parameter.

Definition at line 140 of file DParameterString.h.

References itsValue.

Member Data Documentation

casacore::String casa::DParameterString::itsDefault
private

Store for the default of this parameter.

Definition at line 152 of file DParameterString.h.

Referenced by defaultValue().

casacore::String casa::DParameterString::itsValue
private

Store for the value of this parameter.

Definition at line 155 of file DParameterString.h.

Referenced by value().


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