DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Tasks::Parameter Class Reference

Classes

struct  ValuesIf
 

Public Types

Public Member Functions

 Parameter (const std::string &param_name, const std::string &type_name)
 
 ~Parameter (void)
 
void reader (AbstractParameterParser *r)
 
void read (const std::string &val)
 
bool commit (void)
 
std::string name (void) const
 
std::string value (void) const
 
std::string defaultValue (void) const
 
ParameterdefaultValue (const std::string &val)
 
ParametervaluesIf (const std::string &if_param, const std::string &if_value, const std::string &a_values)
 
Units::Types units (void) const
 
Parameterunits (Units::Types val)
 
std::string description (void) const
 
Parameterdescription (const std::string &val)
 
ParameterminimumValue (const std::string &min_value)
 
ParametermaximumValue (const std::string &max_value)
 
Parametersize (int size_value)
 
ParameterminimumSize (unsigned min_size)
 
ParametermaximumSize (unsigned max_size)
 
Parametervalues (const std::string &list)
 
Parametervisibility (Visibility a_visibility)
 
Parametervisibility (const std::string &a_visibility)
 
Parameterscope (Scope a_scope)
 
Parameterscope (const std::string a_scope)
 
void writeXML (std::ostream &os) const
 
bool changed (void)
 
void setChanged (bool enabled=true)
 
Visibility getVisibility (void) const
 
Scope getScope (void) const
 

Static Public Member Functions

static Visibility visibilityFromString (const std::string &v)
 
static const char * visibilityToString (Visibility v)
 
static Scope scopeFromString (const std::string &s)
 
static const char * scopeToString (Scope s)
 

Protected Attributes

std::string m_name
 
std::string m_type_name
 
std::string m_desc
 
std::string m_default
 
Units::Types m_units
 
std::string m_value
 
std::string m_values
 
unsigned m_min_size
 
unsigned m_max_size
 
std::string m_min_value
 
std::string m_max_value
 
std::vector< ValuesIf * > m_values_if
 
AbstractParameterParserm_reader
 
bool m_changed
 
Visibility m_visibility
 
Scope m_scope
 

Member Enumeration Documentation

Parameter scope.

Enumerator
SCOPE_GLOBAL 

Parameter can be changed in all system states.

SCOPE_IDLE 

Parameter can only be changed when the system is not performing plans/maneuvers.

SCOPE_PLAN 

Parameter can be changed on a per plan basis.

SCOPE_MANEUVER 

Parameter can be changed on a per maneuver basis.

Parameter visibility.

Enumerator
VISIBILITY_USER 

Parameter is visible to the user.

VISIBILITY_DEVELOPER 

Parameter is visible only to developers.

Constructor & Destructor Documentation

DUNE::Tasks::Parameter::Parameter ( const std::string &  param_name,
const std::string &  type_name 
)

Constructor.

DUNE::Tasks::Parameter::~Parameter ( void  )

Destructor.

References m_reader, and m_values_if.

Member Function Documentation

bool DUNE::Tasks::Parameter::changed ( void  )
inline

References m_changed.

bool DUNE::Tasks::Parameter::commit ( void  )
inline
Parameter& DUNE::Tasks::Parameter::defaultValue ( const std::string &  val)
inline

References m_default.

std::string DUNE::Tasks::Parameter::description ( void  ) const
inline
Parameter& DUNE::Tasks::Parameter::description ( const std::string &  val)
inline

References m_desc.

Scope DUNE::Tasks::Parameter::getScope ( void  ) const
inline

References m_scope.

Visibility DUNE::Tasks::Parameter::getVisibility ( void  ) const
inline

References m_visibility.

Parameter& DUNE::Tasks::Parameter::maximumSize ( unsigned  max_size)
inline
Parameter& DUNE::Tasks::Parameter::maximumValue ( const std::string &  max_value)
inline
Parameter& DUNE::Tasks::Parameter::minimumSize ( unsigned  min_size)
inline
Parameter& DUNE::Tasks::Parameter::minimumValue ( const std::string &  min_value)
inline
std::string DUNE::Tasks::Parameter::name ( void  ) const
inline

References m_name.

Referenced by writeXML().

void DUNE::Tasks::Parameter::reader ( AbstractParameterParser r)

References m_reader.

Referenced by DUNE::Tasks::ParameterTable::add().

Parameter& DUNE::Tasks::Parameter::scope ( Scope  a_scope)
inline

References m_scope, and writeXML().

Referenced by DUNE::Tasks::Task::paramActive().

Parameter & DUNE::Tasks::Parameter::scope ( const std::string  a_scope)

References m_scope, and scopeFromString().

Parameter::Scope DUNE::Tasks::Parameter::scopeFromString ( const std::string &  s)
static
const char * DUNE::Tasks::Parameter::scopeToString ( Scope  s)
static
void DUNE::Tasks::Parameter::setChanged ( bool  enabled = true)
inline

References m_changed.

Referenced by DUNE::Tasks::ParameterTable::set().

Parameter& DUNE::Tasks::Parameter::size ( int  size_value)
inline

References maximumSize(), and minimumSize().

Units::Types DUNE::Tasks::Parameter::units ( void  ) const
inline
Parameter& DUNE::Tasks::Parameter::units ( Units::Types  val)
inline

References m_units.

std::string DUNE::Tasks::Parameter::value ( void  ) const
inline

References m_value.

Parameter& DUNE::Tasks::Parameter::values ( const std::string &  list)
inline
Parameter& DUNE::Tasks::Parameter::valuesIf ( const std::string &  if_param,
const std::string &  if_value,
const std::string &  a_values 
)
inline
Parameter& DUNE::Tasks::Parameter::visibility ( Visibility  a_visibility)
inline

Set parameter's visibility.

Parameters
[in]a_visibilitydesired visibility.
Returns
parameter reference.

References m_visibility.

Referenced by DUNE::Navigation::BasicNavigation::BasicNavigation(), and DUNE::Tasks::Task::paramActive().

Parameter & DUNE::Tasks::Parameter::visibility ( const std::string &  a_visibility)

Set parameter's visibility.

Parameters
[in]a_visibilitydesired visibility.
Returns
parameter reference.

References m_visibility, and visibilityFromString().

Parameter::Visibility DUNE::Tasks::Parameter::visibilityFromString ( const std::string &  v)
static

Referenced by visibility().

const char * DUNE::Tasks::Parameter::visibilityToString ( Visibility  v)
static

Member Data Documentation

bool DUNE::Tasks::Parameter::m_changed
protected

True if the value of this parameter changed.

Referenced by changed(), and setChanged().

std::string DUNE::Tasks::Parameter::m_default
protected

Default value.

Referenced by defaultValue(), and writeXML().

std::string DUNE::Tasks::Parameter::m_desc
protected

Description.

Referenced by description(), and writeXML().

unsigned DUNE::Tasks::Parameter::m_max_size
protected

Maximum size.

Referenced by maximumSize(), and writeXML().

std::string DUNE::Tasks::Parameter::m_max_value
protected

Maximum value.

Referenced by maximumValue(), and writeXML().

unsigned DUNE::Tasks::Parameter::m_min_size
protected

Minimum size.

Referenced by minimumSize(), and writeXML().

std::string DUNE::Tasks::Parameter::m_min_value
protected

Minimum value.

Referenced by minimumValue(), and writeXML().

std::string DUNE::Tasks::Parameter::m_name
protected

Name.

Referenced by name(), read(), and writeXML().

AbstractParameterParser* DUNE::Tasks::Parameter::m_reader
protected
Scope DUNE::Tasks::Parameter::m_scope
protected

Parameter scope.

Referenced by getScope(), scope(), and writeXML().

std::string DUNE::Tasks::Parameter::m_type_name
protected

Type name.

Referenced by writeXML().

Units::Types DUNE::Tasks::Parameter::m_units
protected

Units.

Referenced by units(), and writeXML().

std::string DUNE::Tasks::Parameter::m_value
protected

Current value.

Referenced by read(), value(), and writeXML().

std::string DUNE::Tasks::Parameter::m_values
protected

Comma separated list of valid values.

Referenced by values(), and writeXML().

std::vector<ValuesIf*> DUNE::Tasks::Parameter::m_values_if
protected

Conditional comma separated list of valid values.

Referenced by valuesIf(), writeXML(), and ~Parameter().

Visibility DUNE::Tasks::Parameter::m_visibility
protected

Parameter visibility.

Referenced by getVisibility(), visibility(), and writeXML().

Collaboration diagram for DUNE::Tasks::Parameter:
Collaboration graph