Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
uavcan::ReceivedDataStructure< DataType_ > Class Template Reference

#include <generic_subscriber.hpp>

Inheritance diagram for uavcan::ReceivedDataStructure< DataType_ >:
Inheritance graph
[legend]

Public Types

typedef DataType_ DataType
 

Public Member Functions

uint8_t getIfaceIndex () const
 
MonotonicTime getMonotonicTimestamp () const
 
TransferPriority getPriority () const
 
NodeID getSrcNodeID () const
 
TransferID getTransferID () const
 
TransferType getTransferType () const
 
UtcTime getUtcTimestamp () const
 
bool isAnonymousTransfer () const
 

Protected Member Functions

 ReceivedDataStructure ()
 
 ReceivedDataStructure (const IncomingTransfer *arg_transfer)
 

Private Member Functions

template<typename Ret , Ret(IncomingTransfer::*)() const Fun>
Ret safeget () const
 
- Private Member Functions inherited from uavcan::Noncopyable
 Noncopyable ()
 
 ~Noncopyable ()
 

Private Attributes

const IncomingTransfer *const _transfer_
 Such weird name is necessary to avoid clashing with DataType fields. More...
 

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.

Member Typedef Documentation

◆ DataType

template<typename DataType_ >
typedef DataType_ uavcan::ReceivedDataStructure< DataType_ >::DataType

Definition at line 65 of file generic_subscriber.hpp.

Constructor & Destructor Documentation

◆ ReceivedDataStructure() [1/2]

template<typename DataType_ >
uavcan::ReceivedDataStructure< DataType_ >::ReceivedDataStructure ( )
inlineprotected

Definition at line 54 of file generic_subscriber.hpp.

◆ ReceivedDataStructure() [2/2]

template<typename DataType_ >
uavcan::ReceivedDataStructure< DataType_ >::ReceivedDataStructure ( const IncomingTransfer arg_transfer)
inlineprotected

Definition at line 58 of file generic_subscriber.hpp.

Member Function Documentation

◆ getIfaceIndex()

template<typename DataType_ >
uint8_t uavcan::ReceivedDataStructure< DataType_ >::getIfaceIndex ( ) const
inline

Definition at line 76 of file generic_subscriber.hpp.

◆ getMonotonicTimestamp()

template<typename DataType_ >
MonotonicTime uavcan::ReceivedDataStructure< DataType_ >::getMonotonicTimestamp ( ) const
inline

Definition at line 67 of file generic_subscriber.hpp.

◆ getPriority()

template<typename DataType_ >
TransferPriority uavcan::ReceivedDataStructure< DataType_ >::getPriority ( ) const
inline

Definition at line 72 of file generic_subscriber.hpp.

◆ getSrcNodeID()

template<typename DataType_ >
NodeID uavcan::ReceivedDataStructure< DataType_ >::getSrcNodeID ( ) const
inline

Definition at line 75 of file generic_subscriber.hpp.

◆ getTransferID()

template<typename DataType_ >
TransferID uavcan::ReceivedDataStructure< DataType_ >::getTransferID ( ) const
inline

Definition at line 74 of file generic_subscriber.hpp.

◆ getTransferType()

template<typename DataType_ >
TransferType uavcan::ReceivedDataStructure< DataType_ >::getTransferType ( ) const
inline

Definition at line 73 of file generic_subscriber.hpp.

◆ getUtcTimestamp()

template<typename DataType_ >
UtcTime uavcan::ReceivedDataStructure< DataType_ >::getUtcTimestamp ( ) const
inline

Definition at line 71 of file generic_subscriber.hpp.

◆ isAnonymousTransfer()

template<typename DataType_ >
bool uavcan::ReceivedDataStructure< DataType_ >::isAnonymousTransfer ( ) const
inline

Definition at line 77 of file generic_subscriber.hpp.

◆ safeget()

template<typename DataType_ >
template<typename Ret , Ret(IncomingTransfer::*)() const Fun>
Ret uavcan::ReceivedDataStructure< DataType_ >::safeget ( ) const
inlineprivate

Definition at line 44 of file generic_subscriber.hpp.

Member Data Documentation

◆ _transfer_

template<typename DataType_ >
const IncomingTransfer* const uavcan::ReceivedDataStructure< DataType_ >::_transfer_
private

Such weird name is necessary to avoid clashing with DataType fields.

Definition at line 41 of file generic_subscriber.hpp.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:05