Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
dynamicgraph::command::Value Class Reference

This class implements a variant design pattern to handle basic types in Command. More...

#include <value.h>

Public Types

enum  Type {
  NONE, BOOL, UNSIGNED, UNSIGNEDLONGINT,
  INT, LONGINT, FLOAT, DOUBLE,
  STRING, VECTOR, MATRIX, MATRIX4D,
  VALUES, NB_TYPES
}
 

Public Member Functions

bool boolValue () const
 
const ValuesconstValuesValue () const
 
void deleteValue ()
 
double doubleValue () const
 
float floatValue () const
 
int intValue () const
 
long int longintValue () const
 
Eigen::Matrix4d matrix4dValue () const
 
Eigen::MatrixXd matrixXdValue () const
 
Value operator= (const Value &value)
 
bool operator== (const Value &other) const
 
std::string stringValue () const
 
Type type () const
 Return the type of the value. More...
 
unsigned long int unsignedlongintValue () const
 
unsigned unsignedValue () const
 
 Value (const bool &value)
 
 Value (const unsigned &value)
 
 Value (const unsigned long int &value)
 
 Value (const int &value)
 
 Value (const long int &value)
 
 Value (const float &value)
 
 Value (const double &value)
 
 Value (const std::string &value)
 
 Value (const Vector &value)
 
 Value (const Eigen::MatrixXd &value)
 
 Value (const Eigen::Matrix4d &value)
 
 Value (const Values &value)
 
 Value (const Value &value)
 Copy constructor. More...
 
 Value ()
 
const EitherType value () const
 
Values valuesValue () const
 
Vector vectorValue () const
 
 ~Value ()
 

Static Public Member Functions

static std::string typeName (Type type)
 Return the name of the type. More...
 

Public Attributes

Type type_
 
const void *const value_
 

Friends

class EitherType
 
DYNAMIC_GRAPH_DLLAPI friend std::ostream & operator<< (std::ostream &os, const Value &value)
 Output in a stream. More...
 

Detailed Description

This class implements a variant design pattern to handle basic types in Command.

Definition at line 50 of file value.h.

Member Enumeration Documentation

◆ Type

Enumerator
NONE 
BOOL 
UNSIGNED 
UNSIGNEDLONGINT 
INT 
LONGINT 
FLOAT 
DOUBLE 
STRING 
VECTOR 
MATRIX 
MATRIX4D 
VALUES 
NB_TYPES 

Definition at line 52 of file value.h.

Constructor & Destructor Documentation

◆ ~Value()

dynamicgraph::command::Value::~Value ( )

Definition at line 85 of file src/command/value.cpp.

◆ Value() [1/14]

dynamicgraph::command::Value::Value ( const bool &  value)
explicit

Definition at line 87 of file src/command/value.cpp.

◆ Value() [2/14]

dynamicgraph::command::Value::Value ( const unsigned &  value)
explicit

Definition at line 88 of file src/command/value.cpp.

◆ Value() [3/14]

dynamicgraph::command::Value::Value ( const unsigned long int &  value)
explicit

Definition at line 90 of file src/command/value.cpp.

◆ Value() [4/14]

dynamicgraph::command::Value::Value ( const int &  value)
explicit

Definition at line 92 of file src/command/value.cpp.

◆ Value() [5/14]

dynamicgraph::command::Value::Value ( const long int &  value)
explicit

◆ Value() [6/14]

dynamicgraph::command::Value::Value ( const float &  value)
explicit

Definition at line 93 of file src/command/value.cpp.

◆ Value() [7/14]

dynamicgraph::command::Value::Value ( const double &  value)
explicit

Definition at line 94 of file src/command/value.cpp.

◆ Value() [8/14]

dynamicgraph::command::Value::Value ( const std::string &  value)
explicit

Definition at line 95 of file src/command/value.cpp.

◆ Value() [9/14]

dynamicgraph::command::Value::Value ( const Vector value)
explicit

Definition at line 97 of file src/command/value.cpp.

◆ Value() [10/14]

dynamicgraph::command::Value::Value ( const Eigen::MatrixXd &  value)
explicit

Definition at line 98 of file src/command/value.cpp.

◆ Value() [11/14]

dynamicgraph::command::Value::Value ( const Eigen::Matrix4d &  value)
explicit

Definition at line 100 of file src/command/value.cpp.

◆ Value() [12/14]

dynamicgraph::command::Value::Value ( const Values value)
explicit

Definition at line 102 of file src/command/value.cpp.

◆ Value() [13/14]

dynamicgraph::command::Value::Value ( const Value value)

Copy constructor.

Definition at line 104 of file src/command/value.cpp.

◆ Value() [14/14]

dynamicgraph::command::Value::Value ( )
explicit

Definition at line 155 of file src/command/value.cpp.

Member Function Documentation

◆ boolValue()

bool dynamicgraph::command::Value::boolValue ( ) const

Definition at line 204 of file src/command/value.cpp.

◆ constValuesValue()

const Values & dynamicgraph::command::Value::constValuesValue ( ) const

Definition at line 275 of file src/command/value.cpp.

◆ deleteValue()

void dynamicgraph::command::Value::deleteValue ( )

Definition at line 39 of file src/command/value.cpp.

◆ doubleValue()

double dynamicgraph::command::Value::doubleValue ( ) const

Definition at line 239 of file src/command/value.cpp.

◆ floatValue()

float dynamicgraph::command::Value::floatValue ( ) const

Definition at line 231 of file src/command/value.cpp.

◆ intValue()

int dynamicgraph::command::Value::intValue ( ) const

Definition at line 226 of file src/command/value.cpp.

◆ longintValue()

long int dynamicgraph::command::Value::longintValue ( ) const

Definition at line 221 of file src/command/value.cpp.

◆ matrix4dValue()

Eigen::Matrix4d dynamicgraph::command::Value::matrix4dValue ( ) const

Definition at line 263 of file src/command/value.cpp.

◆ matrixXdValue()

Eigen::MatrixXd dynamicgraph::command::Value::matrixXdValue ( ) const

Definition at line 257 of file src/command/value.cpp.

◆ operator=()

Value dynamicgraph::command::Value::operator= ( const Value value)

Definition at line 157 of file src/command/value.cpp.

◆ operator==()

bool dynamicgraph::command::Value::operator== ( const Value other) const

Definition at line 167 of file src/command/value.cpp.

◆ stringValue()

std::string dynamicgraph::command::Value::stringValue ( ) const

Definition at line 247 of file src/command/value.cpp.

◆ type()

Value::Type dynamicgraph::command::Value::type ( ) const

Return the type of the value.

Definition at line 202 of file src/command/value.cpp.

◆ typeName()

std::string dynamicgraph::command::Value::typeName ( Type  type)
static

Return the name of the type.

Definition at line 281 of file src/command/value.cpp.

◆ unsignedlongintValue()

unsigned long int dynamicgraph::command::Value::unsignedlongintValue ( ) const

Definition at line 215 of file src/command/value.cpp.

◆ unsignedValue()

unsigned dynamicgraph::command::Value::unsignedValue ( ) const

Definition at line 209 of file src/command/value.cpp.

◆ value()

const EitherType dynamicgraph::command::Value::value ( ) const

Return the value as a castable value into the approriate type

For instance,

Value v1(5.0); // v1 is of type double
Value v2(3); // v2 is of type int
double x1 = v1.value();
double x2 = v2.value();

The first assignment will succeed, while the second one will throw an exception.

Definition at line 200 of file src/command/value.cpp.

◆ valuesValue()

Values dynamicgraph::command::Value::valuesValue ( ) const

Definition at line 269 of file src/command/value.cpp.

◆ vectorValue()

Vector dynamicgraph::command::Value::vectorValue ( ) const

Definition at line 252 of file src/command/value.cpp.

Friends And Related Function Documentation

◆ EitherType

friend class EitherType
friend

Definition at line 113 of file value.h.

◆ operator<<

DYNAMIC_GRAPH_DLLAPI friend std::ostream& operator<< ( std::ostream &  os,
const Value value 
)
friend

Output in a stream.

Definition at line 310 of file src/command/value.cpp.

Member Data Documentation

◆ type_

Type dynamicgraph::command::Value::type_

Definition at line 127 of file value.h.

◆ value_

const void* const dynamicgraph::command::Value::value_

Definition at line 128 of file value.h.


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


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:06:03