Drake
Drake C++ Documentation
ScalarViewDenseOutput< T > Class Template Reference

Detailed Description

template<typename T>
class drake::systems::ScalarViewDenseOutput< T >

A ScalarDenseOutput class implementation that wraps a DenseOutput class instance and behaves as a view to one of its elements.

Template Parameters
TThe scalar type, which must be one of the default scalars.

#include <drake/systems/analysis/scalar_view_dense_output.h>

Public Member Functions

 ScalarViewDenseOutput (std::unique_ptr< DenseOutput< T >> base_output, int n)
 Constructs a view of another DenseOutput instance. More...
 
const DenseOutput< T > * get_base_output () const
 Returns the base dense output upon which the view operates. More...
 
Does not allow copy, move, or assignment
 ScalarViewDenseOutput (const ScalarViewDenseOutput &)=delete
 
ScalarViewDenseOutputoperator= (const ScalarViewDenseOutput &)=delete
 
 ScalarViewDenseOutput (ScalarViewDenseOutput &&)=delete
 
ScalarViewDenseOutputoperator= (ScalarViewDenseOutput &&)=delete
 
- Public Member Functions inherited from ScalarDenseOutput< T >
virtual ~ScalarDenseOutput ()=default
 
EvaluateScalar (const T &t) const
 Evaluates output at the given time t. More...
 
 ScalarDenseOutput (const ScalarDenseOutput &)=delete
 
ScalarDenseOutputoperator= (const ScalarDenseOutput &)=delete
 
 ScalarDenseOutput (ScalarDenseOutput &&)=delete
 
ScalarDenseOutputoperator= (ScalarDenseOutput &&)=delete
 
- Public Member Functions inherited from DenseOutput< T >
virtual ~DenseOutput ()=default
 
VectorX< T > Evaluate (const T &t) const
 Evaluates the output at the given time t. More...
 
EvaluateNth (const T &t, int n) const
 Evaluates the output value's nth scalar element (0-indexed) at the given time t. More...
 
int size () const
 Returns the output size (i.e. More...
 
bool is_empty () const
 Checks whether the output is empty or not. More...
 
const T & start_time () const
 Returns output's start time, or in other words, the oldest time t that it can be evaluated at e.g. More...
 
const T & end_time () const
 Returns output's end time, or in other words, the newest time t that it can be evaluated at e.g. More...
 
 DenseOutput (const DenseOutput &)=delete
 
DenseOutputoperator= (const DenseOutput &)=delete
 
 DenseOutput (DenseOutput &&)=delete
 
DenseOutputoperator= (DenseOutput &&)=delete
 

Protected Member Functions

DoEvaluateScalar (const T &t) const override
 
bool do_is_empty () const override
 
const T & do_start_time () const override
 
const T & do_end_time () const override
 
- Protected Member Functions inherited from ScalarDenseOutput< T >
 ScalarDenseOutput ()=default
 
VectorX< T > DoEvaluate (const T &t) const override
 
int do_size () const override
 
- Protected Member Functions inherited from DenseOutput< T >
 DenseOutput ()=default
 
virtual T DoEvaluateNth (const T &t, int n) const
 
void ThrowIfOutputIsEmpty (const char *func_name) const
 
void ThrowIfNthElementIsInvalid (const char *func_name, int n) const
 
void ThrowIfTimeIsInvalid (const char *func_name, const T &t) const
 

Protected Attributes

const std::unique_ptr< DenseOutput< T > > base_output_
 
const int n_
 

Constructor & Destructor Documentation

◆ ScalarViewDenseOutput() [1/3]

ScalarViewDenseOutput ( const ScalarViewDenseOutput< T > &  )
delete

◆ ScalarViewDenseOutput() [2/3]

◆ ScalarViewDenseOutput() [3/3]

ScalarViewDenseOutput ( std::unique_ptr< DenseOutput< T >>  base_output,
int  n 
)
explicit

Constructs a view of another DenseOutput instance.

Parameters
base_outputBase dense output to operate with.
nThe nth scalar element (0-indexed) of the output value to view.
Exceptions
std::exceptionif base_output is nullptr.
std::exceptionif given n does not refer to a valid base output dimension i.e. n ∉ [0, base_output->size()).

Member Function Documentation

◆ do_end_time()

const T& do_end_time ( ) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_is_empty()

bool do_is_empty ( ) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ do_start_time()

const T& do_start_time ( ) const
overrideprotectedvirtual

Implements DenseOutput< T >.

◆ DoEvaluateScalar()

T DoEvaluateScalar ( const T &  t) const
overrideprotectedvirtual

◆ get_base_output()

const DenseOutput<T>* get_base_output ( ) const

Returns the base dense output upon which the view operates.

◆ operator=() [1/2]

ScalarViewDenseOutput& operator= ( const ScalarViewDenseOutput< T > &  )
delete

◆ operator=() [2/2]

ScalarViewDenseOutput& operator= ( ScalarViewDenseOutput< T > &&  )
delete

Member Data Documentation

◆ base_output_

const std::unique_ptr<DenseOutput<T> > base_output_
protected

◆ n_

const int n_
protected

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