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

#include <OptionValue.hh>

Inheritance diagram for StringListOptionValue:
Inheritance graph
Collaboration diagram for StringListOptionValue:
Collaboration graph

Public Member Functions

 StringListOptionValue (std::vector< std::string > values)
 
virtual ~StringListOptionValue ()
 
virtual std::string stringValue (int index=0) const
 
virtual int listSize () const
 
virtual void setStringListValue (std::vector< std::string > 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 void setIntegerListValue (std::vector< int > values)
 
virtual int integerValue (int index=0) const
 
virtual double realValue () const
 
virtual bool isFlagOn () const
 
virtual bool isFlagOff () const
 

Private Member Functions

 StringListOptionValue (const StringListOptionValue &)
 Copying not allowed. More...
 
StringListOptionValueoperator= (const StringListOptionValue &)
 Assignment not allowed. More...
 

Private Attributes

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

Detailed Description

OptionValue that has list of strings as value.

Definition at line 237 of file OptionValue.hh.

Constructor & Destructor Documentation

◆ StringListOptionValue() [1/2]

StringListOptionValue::StringListOptionValue ( std::vector< std::string >  values)

Constructor.

Parameters
valueThe values of string list options.

Definition at line 460 of file OptionValue.cc.

460  {
461  values_ = values;
462 }

References values_.

◆ ~StringListOptionValue()

StringListOptionValue::~StringListOptionValue ( )
virtual

Destructor.

Definition at line 467 of file OptionValue.cc.

467  {
468 }

◆ StringListOptionValue() [2/2]

StringListOptionValue::StringListOptionValue ( const StringListOptionValue )
private

Copying not allowed.

Member Function Documentation

◆ listSize()

int StringListOptionValue::listSize ( ) const
virtual

Returns the size of the string list.

Returns
Size of hte list.

Reimplemented from OptionValue.

Definition at line 505 of file OptionValue.cc.

505  {
506  return values_.size();
507 }

References values_.

◆ operator=()

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

Assignment not allowed.

◆ setStringListValue()

void StringListOptionValue::setStringListValue ( std::vector< std::string >  values)
virtual

Sets new value for string list option.

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

Definition at line 477 of file OptionValue.cc.

477  {
478  values_ = values;
479 }

References values_.

◆ stringValue()

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

Returns the value from the given index of string list.

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

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

Reimplemented from OptionValue.

Definition at line 491 of file OptionValue.cc.

491  {
492  if (index < 0 || static_cast<unsigned>(index) > values_.size() - 1) {
493  string procName = "StringListOptionValue::stringValue";
494  throw OutOfRange(__FILE__, __LINE__, procName);
495  }
496  return values_[index];
497 }

References values_.

Member Data Documentation

◆ values_

std::vector<std::string> StringListOptionValue::values_
private

The value of option.

Definition at line 253 of file OptionValue.hh.

Referenced by listSize(), setStringListValue(), StringListOptionValue(), and stringValue().


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