casa
5.7.0-16
|
Implementation of DisplayParameter to store choice parameters. More...
#include <DParameterSwitch.h>
Public Member Functions | |
DParameterSwitch (const casacore::String name, const casacore::String description, const casacore::String help, const casacore::Bool defaultvalue, const casacore::Bool value, const casacore::String context="") | |
Constructor taking the name of the parameter, a short description, some help text, a default value, an initial value, the context of the parameter. More... | |
DParameterSwitch (const DParameterSwitch &other) | |
(Required) copy constructor. More... | |
virtual | ~DParameterSwitch () |
Destructor. More... | |
DParameterSwitch & | operator= (const DParameterSwitch &other) |
(Required) copy assignment. More... | |
virtual casacore::Bool | fromRecord (const casacore::RecordInterface &record) |
Parse record , and update 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::Bool | defaultValue () const |
Return the default for this parameter. More... | |
casacore::Bool | value () const |
Return the current value of this parameter. More... | |
void | setDefaultValue (const casacore::Bool defaultvalue) |
Set or change the default value for this parameter. More... | |
void | setValue (const casacore::Bool value) |
Set or change the current value. 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 | |
DParameterSwitch () | |
(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... | |
DisplayParameter & | operator= (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 DisplayOptions & | displayOptions () const |
Return the DisplayOptions to use for parsing Records. More... | |
Private Attributes | |
casacore::Bool | itsDefaultValue |
Store for the default of this parameter. More... | |
casacore::Bool | itsValue |
Store for the value of this parameter. More... | |
Implementation of DisplayParameter to store choice parameters.
Public interface
DParameterSwitch is an implementation of a DisplayParameter providing a boolean (switch) parameter type.
This class is derived from DisplayParameter and provides a boolean switch parameter. Parameters can be true or false. They cannot be unset.
Switches are common.
Definition at line 94 of file DParameterSwitch.h.
casa::DParameterSwitch::DParameterSwitch | ( | const casacore::String | name, |
const casacore::String | description, | ||
const casacore::String | help, | ||
const casacore::Bool | defaultvalue, | ||
const casacore::Bool | value, | ||
const casacore::String | context = "" |
||
) |
Constructor taking the name of the parameter, a short description, some help text, a default value, an initial value, the context of the parameter.
casa::DParameterSwitch::DParameterSwitch | ( | const DParameterSwitch & | other | ) |
(Required) copy constructor.
|
virtual |
Destructor.
|
protected |
(Required) default constructor.
|
inline |
Return the default for this parameter.
Definition at line 131 of file DParameterSwitch.h.
References itsDefaultValue.
|
virtual |
Parse record
, and update this parameter.
Return true
if the parameter is changed, otherwise return false
.
Implements casa::DisplayParameter.
DParameterSwitch& casa::DParameterSwitch::operator= | ( | const DParameterSwitch & | other | ) |
(Required) copy assignment.
|
inline |
Set or change the default value for this parameter.
Definition at line 141 of file DParameterSwitch.h.
References itsDefaultValue.
|
inline |
Set or change the current value.
Definition at line 146 of file DParameterSwitch.h.
|
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.
|
inline |
Return the current value of this parameter.
Definition at line 136 of file DParameterSwitch.h.
References itsValue.
Referenced by casa::Profile2dDD::profileAutoscale(), setValue(), and casa::Profile2dDD::showRestFrequency().
|
private |
Store for the default of this parameter.
Definition at line 158 of file DParameterSwitch.h.
Referenced by defaultValue(), and setDefaultValue().
|
private |
Store for the value of this parameter.
Definition at line 161 of file DParameterSwitch.h.
Referenced by setValue(), and value().