OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
OptionValue Class Reference

#include <OptionValue.hh>

Inheritance diagram for OptionValue:
Inheritance graph
Collaboration diagram for OptionValue:
Collaboration graph

Public Member Functions

 OptionValue ()
 
virtual ~OptionValue ()
 
virtual void setStringValue (const std::string &)
 
virtual void setIntegerValue (int)
 
virtual void setUnsignedIntegerValue (unsigned)
 
virtual void setRealValue (double)
 
virtual void setBoolValue (bool)
 
virtual void setIntegerListValue (std::vector< int > values)
 
virtual std::string stringValue (int index=0) const
 
virtual int integerValue (int index=0) const
 
virtual double realValue () const
 
virtual bool isFlagOn () const
 
virtual bool isFlagOff () const
 
virtual int listSize () const
 

Private Member Functions

 OptionValue (const OptionValue &)
 Copying not allowed.
 
OptionValueoperator= (const OptionValue &)
 Assignment not allowed.
 

Detailed Description

An abstract base class for modeling all kinds of options.

Possible option types are bool, real, int, and string. Each option knows its name and description.

Definition at line 51 of file OptionValue.hh.

Constructor & Destructor Documentation

◆ OptionValue() [1/2]

OptionValue::OptionValue ( )

Constructor.

Definition at line 51 of file OptionValue.cc.

51 {
52}

◆ ~OptionValue()

OptionValue::~OptionValue ( )
virtual

Destructor.

Definition at line 57 of file OptionValue.cc.

57 {
58}

◆ OptionValue() [2/2]

OptionValue::OptionValue ( const OptionValue )
private

Copying not allowed.

Member Function Documentation

◆ integerValue()

int OptionValue::integerValue ( int  index = 0) const
virtual

This implementation should never be called.

Returns
Nothing.
Exceptions
WrongSubclassCalled for a wrong subclass.
OutOfRangeNever thrown by this function.

Reimplemented in IntegerOptionValue, and IntegerListOptionValue.

Definition at line 129 of file OptionValue.cc.

129 {
130 throw WrongSubclass(__FILE__, __LINE__, __func__);
131 return 0;
132}
#define __func__

References __func__.

◆ isFlagOff()

bool OptionValue::isFlagOff ( ) const
virtual

This implementation should never be called.

Returns
Nothing.
Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in BoolOptionValue.

Definition at line 178 of file OptionValue.cc.

178 {
179 throw WrongSubclass(__FILE__, __LINE__, __func__);
180 return false;
181}

References __func__.

◆ isFlagOn()

bool OptionValue::isFlagOn ( ) const
virtual

This implementation should never be called.

Returns
Nothing.
Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in BoolOptionValue.

Definition at line 166 of file OptionValue.cc.

166 {
167 throw WrongSubclass(__FILE__, __LINE__, __func__);
168 return false;
169}

References __func__.

Referenced by ToggleUnitDetailsCmd::Do(), UnitFigure::drawSelf(), ToggleUnitDetailsCmd::isChecked(), UnitFigure::layoutSelf(), ProximMachineStateWindow::onToggleUnitInfo(), and ProximMachineStateWindow::onUpdateUIEvent().

◆ listSize()

int OptionValue::listSize ( ) const
virtual

This implementation should never be called.

Returns
Nothing.
Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in IntegerListOptionValue, and StringListOptionValue.

Definition at line 190 of file OptionValue.cc.

190 {
191 throw WrongSubclass(__FILE__, __LINE__, __func__);
192 return 0;
193}

References __func__.

◆ operator=()

OptionValue & OptionValue::operator= ( const OptionValue )
private

Assignment not allowed.

◆ realValue()

double OptionValue::realValue ( ) const
virtual

This implementation should never be called.

Returns
Nothing.
Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in RealOptionValue.

Definition at line 154 of file OptionValue.cc.

154 {
155 throw WrongSubclass(__FILE__, __LINE__, __func__);
156 return 0;
157}

References __func__.

◆ setBoolValue()

void OptionValue::setBoolValue ( bool  )
virtual

This implementation should never be called.

Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in BoolOptionValue.

Definition at line 106 of file OptionValue.cc.

106 {
107 throw WrongSubclass(__FILE__, __LINE__, __func__);
108}

References __func__.

Referenced by ToggleUnitDetailsCmd::Do(), and ProximMachineStateWindow::onToggleUnitInfo().

◆ setIntegerListValue()

void OptionValue::setIntegerListValue ( std::vector< int >  values)
virtual

This implementation should never be called.

Returns
Nothing.
Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in IntegerListOptionValue.

Definition at line 117 of file OptionValue.cc.

117 {
118 throw WrongSubclass(__FILE__, __LINE__, __func__);
119}

References __func__.

◆ setIntegerValue()

void OptionValue::setIntegerValue ( int  )
virtual

This implementation should never be called.

Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in IntegerOptionValue.

Definition at line 76 of file OptionValue.cc.

76 {
77 throw WrongSubclass(__FILE__, __LINE__, __func__);
78}

References __func__.

◆ setRealValue()

void OptionValue::setRealValue ( double  )
virtual

This implementation should never be called.

Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in RealOptionValue.

Definition at line 96 of file OptionValue.cc.

96 {
97 throw WrongSubclass(__FILE__, __LINE__, __func__);
98}

References __func__.

◆ setStringValue()

void OptionValue::setStringValue ( const std::string &  )
virtual

This implementation should never be called.

Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in StringOptionValue.

Definition at line 66 of file OptionValue.cc.

66 {
67 throw WrongSubclass(__FILE__, __LINE__, __func__);
68}

References __func__.

◆ setUnsignedIntegerValue()

void OptionValue::setUnsignedIntegerValue ( unsigned  )
virtual

This implementation should never be called.

Exceptions
WrongSubclassCalled for a wrong subclass.

Reimplemented in UnsignedIntegerOptionValue.

Definition at line 86 of file OptionValue.cc.

86 {
87 throw WrongSubclass(__FILE__, __LINE__, __func__);
88}

References __func__.

◆ stringValue()

std::string OptionValue::stringValue ( int  index = 0) const
virtual

This implementation should never be called.

Returns
Nothing.
Exceptions
WrongSubclassCalled for a wrong subclass.
OutOfRangeNever thrown by this function.

Reimplemented in StringOptionValue, and StringListOptionValue.

Definition at line 142 of file OptionValue.cc.

142 {
143 throw WrongSubclass(__FILE__, __LINE__, __func__);
144 return "";
145}

References __func__.


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