template<class T>
BipedalLocomotion::System::SharedResource class

Basic class that contains a shared resource between two Block classes.

Since this class is a shared resource you can use it only with shared_ptr. For this reason the only way to create a shared resource is to use the SharedResource::create() static method. If want a visual interpretation of shared resource you may imagine it as the wire connecting two blocks running in two separate threads. The implementation of SharedResource is thread safe.

Public types

using Ptr = std::shared_ptr<SharedResource<T>>

Public static functions

static auto create() -> Ptr
Method used to create a shared resource.

Public functions

void set(const T& resource)
Set the resource.
auto get() const -> T
Get the resource.

Function documentation

template<class T>
static Ptr BipedalLocomotion::System::SharedResource<T>::create()

Method used to create a shared resource.

Returns a pointer of a shared resource.

template<class T>
T BipedalLocomotion::System::SharedResource<T>::get() const

Get the resource.

Returns the copy of the object inside the shared resource.