OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IntegerListOptionValue Class Reference

#include <OptionValue.hh>

Inheritance diagram for IntegerListOptionValue:
Inheritance graph
Collaboration diagram for IntegerListOptionValue:
Collaboration graph

Public Member Functions

 IntegerListOptionValue (std::vector< int > values)
 
virtual ~IntegerListOptionValue ()
 
virtual int integerValue (int index=0) const
 
virtual int listSize () const
 
virtual void setIntegerListValue (std::vector< int > values)
 
- Public Member Functions inherited from OptionValue
 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 std::string stringValue (int index=0) const
 
virtual double realValue () const
 
virtual bool isFlagOn () const
 
virtual bool isFlagOff () const
 

Private Member Functions

 IntegerListOptionValue (const IntegerListOptionValue &)
 Copying not allowed. More...
 
IntegerListOptionValueoperator= (const IntegerListOptionValue &)
 Assignment not allowed. More...
 

Private Attributes

std::vector< int > values_
 The value of option. More...
 

Detailed Description

OptionValue that has list of integers as value.

Definition at line 210 of file OptionValue.hh.

Constructor & Destructor Documentation

◆ IntegerListOptionValue() [1/2]

IntegerListOptionValue::IntegerListOptionValue ( std::vector< int >  values)

Constructor.

Parameters
valueThe values of integer list options.

Definition at line 402 of file OptionValue.cc.

402  {
403  values_ = values;
404 }

References values_.

◆ ~IntegerListOptionValue()

IntegerListOptionValue::~IntegerListOptionValue ( )
virtual

Destructor.

Definition at line 409 of file OptionValue.cc.

409  {
410 }

◆ IntegerListOptionValue() [2/2]

IntegerListOptionValue::IntegerListOptionValue ( const IntegerListOptionValue )
private

Copying not allowed.

Member Function Documentation

◆ integerValue()

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

Returns the value from the given index of integer list.

The index must be given between 0 and the size of value vector - 1

Returns
The value from the given index of integer list.
Exceptions
WrongSubclassIs never thrown by this function.
OutOfRangeIf the index is out of the range.

Reimplemented from OptionValue.

Definition at line 433 of file OptionValue.cc.

433  {
434  if (index < 0 || static_cast<unsigned>(index) > values_.size() - 1) {
435  string procName = "IntegerListOptionValue::integerValue";
436  throw OutOfRange(__FILE__, __LINE__, procName);
437  }
438  return values_[index];
439 }

References values_.

◆ listSize()

int IntegerListOptionValue::listSize ( ) const
virtual

Returns the size of the integer list.

Returns
Size of hte list.

Reimplemented from OptionValue.

Definition at line 447 of file OptionValue.cc.

447  {
448  return values_.size();
449 }

References values_.

◆ operator=()

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

Assignment not allowed.

◆ setIntegerListValue()

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

Sets new value for integer list option.

Parameters
valueNew value for the integer list option.
Exceptions
WrongSubclassIs never thrown by this function.

Reimplemented from OptionValue.

Definition at line 419 of file OptionValue.cc.

419  {
420  values_ = values;
421 }

References values_.

Member Data Documentation

◆ values_

std::vector<int> IntegerListOptionValue::values_
private

The value of option.

Definition at line 226 of file OptionValue.hh.

Referenced by IntegerListOptionValue(), integerValue(), listSize(), and setIntegerListValue().


The documentation for this class was generated from the following files:
OutOfRange
Definition: Exception.hh:320
IntegerListOptionValue::values_
std::vector< int > values_
The value of option.
Definition: OptionValue.hh:226