This class is derived from
(Required) copy constructor.
Destructor.
(Required) copy assignment.
Parse record, and update this parameter. Return
True if the parameter is changed, otherwise return
False.
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.
Return the default for this parameter.
Return the current value of this parameter.
Set or change the default value for this parameter.
Set or change the current value.
Example
DParameterSwitch pswitch("myswitch", "Axis labels",
"Do you want to draw axis labels?",
True,True);
// ...
// update the parameter from some Record
pswitch.fromRecord(rec);
// examine the value of the parameter
if (pswitch.value()) {
// ...
}
Motivation
Switches are common.
Thrown Exceptions
To Do
Member Description
DParameterSwitch(const String name, const String description, const String help, const Bool defaultvalue, const Bool value, const 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.
DParameterSwitch(const DParameterSwitch& other)
virtual ~DParameterSwitch()
DParameterSwitch& operator=(const DParameterSwitch& other)
virtual Bool fromRecord(const RecordInterface& record)
virtual void toRecord(RecordInterface& record, const Bool fullrecord = True, const Bool overwrite = False)
Bool defaultValue() const
Bool value() const
void setDefaultValue(const Bool defaultvalue)
void setValue(const Bool value)
DParameterSwitch()
(Required) default constructor.