Drake
Drake C++ Documentation
AbstractValues Class Reference

Detailed Description

AbstractValues is a container for non-numerical state and parameters.

It may or may not own the underlying data, and therefore is suitable for both leaf Systems and diagrams.

#include <drake/systems/framework/abstract_values.h>

Public Member Functions

 AbstractValues ()
 Constructs an empty AbstractValues. More...
 
 AbstractValues (std::vector< std::unique_ptr< AbstractValue >> &&data)
 Constructs an AbstractValues that owns the underlying data. More...
 
 AbstractValues (const std::vector< AbstractValue * > &data)
 Constructs an AbstractValues that does not own the underlying data. More...
 
 AbstractValues (std::unique_ptr< AbstractValue > datum)
 Constructs an AbstractValues that owns a single datum. More...
 
virtual ~AbstractValues ()
 
int size () const
 Returns the number of elements of AbstractValues. More...
 
const AbstractValueget_value (int index) const
 Returns the element of AbstractValues at the given index, or aborts if the index is out-of-bounds. More...
 
AbstractValueget_mutable_value (int index)
 Returns the element of AbstractValues at the given index, or aborts if the index is out-of-bounds. More...
 
void SetFrom (const AbstractValues &other)
 Copies all of the AbstractValues in other into this. More...
 
std::unique_ptr< AbstractValuesClone () const
 Returns a deep copy of all the data in this AbstractValues. More...
 
Does not allow copy, move, or assignment
 AbstractValues (const AbstractValues &)=delete
 
AbstractValuesoperator= (const AbstractValues &)=delete
 
 AbstractValues (AbstractValues &&)=delete
 
AbstractValuesoperator= (AbstractValues &&)=delete
 

Constructor & Destructor Documentation

◆ AbstractValues() [1/6]

AbstractValues ( const AbstractValues )
delete

◆ AbstractValues() [2/6]

AbstractValues ( AbstractValues &&  )
delete

◆ AbstractValues() [3/6]

Constructs an empty AbstractValues.

◆ AbstractValues() [4/6]

AbstractValues ( std::vector< std::unique_ptr< AbstractValue >> &&  data)
explicit

Constructs an AbstractValues that owns the underlying data.

◆ AbstractValues() [5/6]

AbstractValues ( const std::vector< AbstractValue * > &  data)
explicit

Constructs an AbstractValues that does not own the underlying data.

◆ AbstractValues() [6/6]

AbstractValues ( std::unique_ptr< AbstractValue datum)
explicit

Constructs an AbstractValues that owns a single datum.

◆ ~AbstractValues()

virtual ~AbstractValues ( )
virtual

Member Function Documentation

◆ Clone()

std::unique_ptr<AbstractValues> Clone ( ) const

Returns a deep copy of all the data in this AbstractValues.

The clone will own its own data. This is true regardless of whether the data being cloned had ownership of its data or not.

◆ get_mutable_value()

AbstractValue& get_mutable_value ( int  index)

Returns the element of AbstractValues at the given index, or aborts if the index is out-of-bounds.

◆ get_value()

const AbstractValue& get_value ( int  index) const

Returns the element of AbstractValues at the given index, or aborts if the index is out-of-bounds.

◆ operator=() [1/2]

AbstractValues& operator= ( const AbstractValues )
delete

◆ operator=() [2/2]

AbstractValues& operator= ( AbstractValues &&  )
delete

◆ SetFrom()

void SetFrom ( const AbstractValues other)

Copies all of the AbstractValues in other into this.

Asserts if the two are not equal in size.

Exceptions
std::exceptionif any of the elements are of incompatible type.

◆ size()

int size ( ) const

Returns the number of elements of AbstractValues.


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