libuav original

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

ReceivedDataStructure< DataType_ > Class Template Reference

ReceivedDataStructure< DataType_ > Class Template Reference

This class extends the data structure with extra information obtained from the transport layer, such as Source Node ID, timestamps, Transfer ID, index of the interface this transfer was picked up from, etc. More...

#include <generic_subscriber.hpp>

Inherits uavcan::Noncopyable.


Detailed Description

template<typename DataType_>
class uavcan::ReceivedDataStructure< DataType_ >

This class extends the data structure with extra information obtained from the transport layer, such as Source Node ID, timestamps, Transfer ID, index of the interface this transfer was picked up from, etc.

PLEASE NOTE that since this class inherits the data structure type, subscription callbacks can accept either object of this class or the data structure type directly if the extra information is not needed.

For example, both of these callbacks can be used with the same data structure 'Foo': void first(const ReceivedDataStructure<Foo>& msg); void second(const Foo& msg); In the latter case, an implicit cast will happen before the callback is invoked.

This class is not copyable because it holds a reference to a stack-allocated transfer descriptor object. You can slice cast it to the underlying data type though, which would be copyable: DataType dt = rds; // where rds is of type ReceivedDataStructure<DataType> // dt is now copyable

Definition at line 39 of file generic_subscriber.hpp.