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
 
std::int32_t intValue () const
 
std::int64_t 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...
 
std::uint64_t unsignedlongintValue () const
 
std::uint32_t unsignedValue () const
 
 Value ()
 
const EitherType value () const
 
 Value (const bool &value)
 
 Value (const double &value)
 
 Value (const Eigen::Matrix4d &value)
 
 Value (const Eigen::MatrixXd &value)
 
 Value (const float &value)
 
 Value (const std::int32_t &value)
 
 Value (const std::int64_t &value)
 
 Value (const std::string &value)
 
 Value (const std::uint32_t &value)
 
 Value (const std::uint64_t &value)
 
 Value (const Value &value)
 Copy constructor. More...
 
 Value (const Values &value)
 
 Value (const Vector &value)
 
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 51 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 53 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 std::uint32_t &  value)
explicit

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

◆ Value() [3/14]

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

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

◆ Value() [4/14]

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

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

◆ Value() [5/14]

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

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

◆ Value() [6/14]

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

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

◆ Value() [7/14]

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

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

◆ Value() [8/14]

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

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

◆ Value() [9/14]

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

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

◆ Value() [10/14]

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

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

◆ Value() [11/14]

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

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

◆ Value() [12/14]

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

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

◆ Value() [13/14]

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

Copy constructor.

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

◆ Value() [14/14]

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

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

Member Function Documentation

◆ boolValue()

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

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

◆ constValuesValue()

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

Definition at line 278 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 242 of file src/command/value.cpp.

◆ floatValue()

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

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

◆ intValue()

std::int32_t dynamicgraph::command::Value::intValue ( ) const

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

◆ longintValue()

std::int64_t dynamicgraph::command::Value::longintValue ( ) const

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

◆ matrix4dValue()

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

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

◆ matrixXdValue()

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

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

◆ operator=()

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

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

◆ operator==()

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

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

◆ stringValue()

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

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

◆ type()

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

Return the type of the value.

Definition at line 205 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 284 of file src/command/value.cpp.

◆ unsignedlongintValue()

std::uint64_t dynamicgraph::command::Value::unsignedlongintValue ( ) const

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

◆ unsignedValue()

std::uint32_t dynamicgraph::command::Value::unsignedValue ( ) const

Definition at line 212 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 203 of file src/command/value.cpp.

◆ valuesValue()

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

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

◆ vectorValue()

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

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

Friends And Related Function Documentation

◆ EitherType

friend class EitherType
friend

Definition at line 114 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 313 of file src/command/value.cpp.

Member Data Documentation

◆ type_

Type dynamicgraph::command::Value::type_

Definition at line 128 of file value.h.

◆ value_

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

Definition at line 129 of file value.h.


The documentation for this class was generated from the following files:
dynamicgraph::command::Value::Value
Value()
Definition: src/command/value.cpp:158


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:39