Drake
VectorObject< T > Class Template Reference

This concrete class provides object semantics to an abstract VectorInterface by implementing a copy constructor and copy assignment using the VectorInterface's Clone() method. More...

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

Public Member Functions

 VectorObject () noexcept
 Constructs an empty VectorObject. More...
 
 VectorObject (std::unique_ptr< VectorInterface< T >> vector) noexcept
 Takes over ownership of the provided VectorInterface object. More...
 
 VectorObject (const VectorObject &source)
 Copy constructor uses the source object's Clone() method to make a deep copy which is then owned by this VectorObject. More...
 
 VectorObject (VectorObject &&source) noexcept
 Move construction leaves source empty. More...
 
VectorObjectoperator= (const VectorObject &source)
 Copy assignment replaces the current contents of this VectorObject with a clone of the source object. More...
 
VectorObjectoperator= (VectorObject &&source) noexcept
 Move assignment leaves source empty. More...
 
const VectorInterface< T > & get_vector () const
 Returns a const reference to the VectorInterface object owned by this VectorObject, if any. More...
 
VectorInterface< T > * get_mutable_vector ()
 Returns a mutable pointer to the VectorInterface object owned by this VectorObject, if any. More...
 
bool empty () const noexcept
 Returns true if this VectorObject does not own a VectorInterface object. More...
 

Detailed Description

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

This concrete class provides object semantics to an abstract VectorInterface by implementing a copy constructor and copy assignment using the VectorInterface's Clone() method.

A VectorObject is default-, copy-, and move-constructible, and copy- and move-assignable.

Constructor & Destructor Documentation

VectorObject ( )
inlinenoexcept

Constructs an empty VectorObject.

VectorObject ( std::unique_ptr< VectorInterface< T >>  vector)
inlineexplicitnoexcept

Takes over ownership of the provided VectorInterface object.

VectorObject ( const VectorObject< T > &  source)
inline

Copy constructor uses the source object's Clone() method to make a deep copy which is then owned by this VectorObject.

Here is the call graph for this function:

VectorObject ( VectorObject< T > &&  source)
inlinenoexcept

Move construction leaves source empty.

Member Function Documentation

bool empty ( ) const
inlinenoexcept

Returns true if this VectorObject does not own a VectorInterface object.

Check this first before calling get_vector() or get_mutable_vector().

Here is the caller graph for this function:

VectorInterface<T>* get_mutable_vector ( )
inline

Returns a mutable pointer to the VectorInterface object owned by this VectorObject, if any.

Don't call this on an empty object; check first with empty() if you aren't sure.

Exceptions
std::logic_errorThis object is empty.

Here is the caller graph for this function:

const VectorInterface<T>& get_vector ( ) const
inline

Returns a const reference to the VectorInterface object owned by this VectorObject, if any.

Don't call this on an empty object; check first with empty() if you aren't sure.

Exceptions
std::logic_errorThis object is empty.

Here is the caller graph for this function:

VectorObject& operator= ( const VectorObject< T > &  source)
inline

Copy assignment replaces the current contents of this VectorObject with a clone of the source object.

Here is the call graph for this function:

VectorObject& operator= ( VectorObject< T > &&  source)
inlinenoexcept

Move assignment leaves source empty.


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