Awali
Another Weighted Automata library
Public Types | Public Member Functions | Data Fields
awali::dyn::internal::option_t< T > Class Template Reference

#include <option.hh>

Public Types

using value_t = T
 

Public Member Functions

 option_t (std::string name, T def, acceptor_t< T > acc=acceptor_t< T >())
 
bool acceptable (T value)
 
value_t get_default_value ()
 
value_t of_string (std::string const &str)
 Create of value of the type expected by this option_t, from string str. More...
 
 operator internal::option_value_pair_t ()
 
template<typename X >
internal::option_value_pair_t operator= (const X &value)
 
void set_default_value (value_t new_default_value)
 
option_t< value_twith_default_value (value_t new_default_value)
 Creates a phony option_t that overrides system default value (but not user defined default, if set). More...
 

Data Fields

const size_t id
 

Member Typedef Documentation

◆ value_t

template<typename T >
using awali::dyn::internal::option_t< T >::value_t = T

Constructor & Destructor Documentation

◆ option_t()

template<typename T >
awali::dyn::internal::option_t< T >::option_t ( std::string  name,
def,
acceptor_t< T >  acc = acceptor_t<T>() 
)

Member Function Documentation

◆ acceptable()

template<typename T >
bool awali::dyn::internal::option_t< T >::acceptable ( value)

◆ get_default_value()

template<typename T >
value_t awali::dyn::internal::option_t< T >::get_default_value ( )

◆ of_string()

template<typename T >
value_t awali::dyn::internal::option_t< T >::of_string ( std::string const &  str)

Create of value of the type expected by this option_t, from string str.

Supports the string "default".

◆ operator internal::option_value_pair_t()

template<typename T >
awali::dyn::internal::option_t< T >::operator internal::option_value_pair_t ( )

◆ operator=()

template<typename T >
template<typename X >
internal::option_value_pair_t awali::dyn::internal::option_t< T >::operator= ( const X &  value)

◆ set_default_value()

template<typename T >
void awali::dyn::internal::option_t< T >::set_default_value ( value_t  new_default_value)

◆ with_default_value()

template<typename T >
option_t<value_t> awali::dyn::internal::option_t< T >::with_default_value ( value_t  new_default_value)

Creates a phony option_t that overrides system default value (but not user defined default, if set).

Beware

Not intended for end users.

Example

options_t opt = {}
boolean inplace1 = opt[IN_PLACE] // `false` (system default)
boolean inplace2 = opt[IN_PLACE.with_default_value(true)] // `true` (local default)
IN_PLACE.set_default_value(false); // end user sets a default value
boolean inplace3 = opt[IN_PLACE.with_default_value(true)] // 'false` (user defined default value)
internal::option_t< bool > IN_PLACE
Option used when an algorithm may be done in place.

Field Documentation

◆ id

template<typename T >
const size_t awali::dyn::internal::option_t< T >::id

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