dca_interface  6.3.4
dca::OptionValue Class Reference

#include <base_options.h>

Detailed Description

Generic encapsulation of a value used in Options objects.

See also
Options, OptionKey

Definition at line 25 of file base_options.h.

Public Types

enum  OptionValueType { OVT_Unknown = 0, OVT_Integer, OVT_Double, OVT_String }
 Defines the available types of an option value. More...
 

Public Member Functions

 OptionValue ()
 Creates an option value with unknown type.
 
 OptionValue (int)
 Creates an option value with integer type and sets the value.
 
 OptionValue (double)
 Creates an option value with double type and sets the value.
 
 OptionValue (const std::string &)
 Creates an option value with string type and sets the value.
 
OptionValueType type () const
 Returns type of the option value.
 
 operator int () const
 Returns given option value as int (assume type is OVT_Integer else an ExDca exception will be thrown).
 
OptionValueoperator= (int)
 Is used to assign a new value and set the type to integer.
 
 operator double () const
 Returns given option value as double (assume type is OVT_Double else an ExDca exception will be thrown).
 
OptionValueoperator= (double)
 Is used to assign a new value and set the type to double.
 
 operator std::string () const
 Returns given option value as string (assume type is OVT_String else an ExDca exception will be thrown).
 
OptionValueoperator= (const std::string &)
 Is used to assign a new value and set the type to string.
 

Member Enumeration Documentation

◆ OptionValueType

Defines the available types of an option value.

Enumerator
OVT_Unknown 

Unassigned option type.

OVT_Integer 

Option type is numeric (signed)

OVT_Double 

Option type is floating point.

OVT_String 

Option type is string.

Definition at line 29 of file base_options.h.


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