maliput
ValueToVectorValue< T > Class Template Reference

Detailed Description

template<typename T>
class maliput::drake::systems::internal::ValueToVectorValue< T >

Implements Drake policy for taking a concrete vector type and storing it in a Drake numerical vector object as an AbstractValue of concrete type Value<BasicVector<T>>.

We call this "VectorPolicy" to distinguish it from the "AbstractPolicy" implemented by ValueToAbstractValue.

See also
ValueToAbstractValue for usage information and some restrictions.

VectorPolicy

  1. Any Eigen vector type is copied into a Value<BasicVector<T>>.
  2. A scalar of type T is treated as though it were an Eigen Vector1<T>.
  3. Any BasicVector or type derived from BasicVector is cloned into a Value<BasicVector<T>> although the stored object still has the most-derived type.
  4. Any AbstractValue object is simply cloned. The resulting clone must have exactly type Value<BasicVector<T>> or an std::logic_error is thrown.

Any other type results in an std::logic_error being thrown (at runtime). This internal class is intended to be invoked by different user-visible APIs so provides for the API name to be included in any generated runtime error messages.

@tparam_default_scalar

#include <src/maliput/drake/systems/framework/value_to_abstract_value.h>

Static Public Member Functions

static std::unique_ptr< AbstractValueToAbstract (const char *api_name, const Eigen::Ref< const VectorX< T >> &vector)
 
static std::unique_ptr< AbstractValueToAbstract (const char *api_name, const T &scalar)
 
static std::unique_ptr< AbstractValueToAbstract (const char *api_name, const BasicVector< T > &vector)
 
static std::unique_ptr< AbstractValueToAbstract (const char *api_name, const AbstractValue &value)
 
template<typename ValueType , typename = std::enable_if_t<!(is_eigen_refable<ValueType>() || std::is_base_of_v<BasicVector<T>, ValueType> || std::is_base_of_v<AbstractValue, ValueType>)>>
static std::unique_ptr< AbstractValueToAbstract (const char *api_name, const ValueType &)
 

Member Function Documentation

◆ ToAbstract() [1/5]

static std::unique_ptr<AbstractValue> ToAbstract ( const char *  api_name,
const AbstractValue value 
)
static

◆ ToAbstract() [2/5]

static std::unique_ptr<AbstractValue> ToAbstract ( const char *  api_name,
const BasicVector< T > &  vector 
)
static

◆ ToAbstract() [3/5]

static std::unique_ptr<AbstractValue> ToAbstract ( const char *  api_name,
const Eigen::Ref< const VectorX< T >> &  vector 
)
static

◆ ToAbstract() [4/5]

static std::unique_ptr<AbstractValue> ToAbstract ( const char *  api_name,
const T &  scalar 
)
static

◆ ToAbstract() [5/5]

static std::unique_ptr<AbstractValue> ToAbstract ( const char *  api_name,
const ValueType &   
)
static

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