AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | List of all members
isobus::CANMessageData Class Referenceabstract

A interface class that represents data payload of a CAN message of arbitrary length. More...

#include <can_message_data.hpp>

Inheritance diagram for isobus::CANMessageData:
[legend]

Public Member Functions

virtual ~CANMessageData ()=default
 Default destructor.
 
virtual std::size_t size () const =0
 Get the size of the data.
 
virtual std::uint8_t get_byte (std::size_t index)=0
 Get the byte at the given index.
 
virtual std::unique_ptr< CANMessageDatacopy_if_not_owned (std::unique_ptr< CANMessageData > self) const =0
 If the data isn't owned by this class, make a copy of the data.
 

Detailed Description

A interface class that represents data payload of a CAN message of arbitrary length.

Definition at line 25 of file can_message_data.hpp.

Member Function Documentation

◆ copy_if_not_owned()

virtual std::unique_ptr< CANMessageData > isobus::CANMessageData::copy_if_not_owned ( std::unique_ptr< CANMessageData > self) const
pure virtual

If the data isn't owned by this class, make a copy of the data.

Parameters
[in]selfA pointer to this object.
Returns
A copy of the data if it isn't owned by this class, otherwise a moved pointer.

Implemented in isobus::CANMessageDataVector, isobus::CANMessageDataView, and isobus::CANMessageDataCallback.

◆ get_byte()

virtual std::uint8_t isobus::CANMessageData::get_byte ( std::size_t index)
pure virtual

Get the byte at the given index.

Parameters
[in]indexThe index of the byte to get.
Returns
The byte at the given index.

Implemented in isobus::CANMessageDataVector, isobus::CANMessageDataView, and isobus::CANMessageDataCallback.

◆ size()

virtual std::size_t isobus::CANMessageData::size ( ) const
pure virtual

Get the size of the data.

Returns
The size of the data.

Implemented in isobus::CANMessageDataVector, isobus::CANMessageDataView, and isobus::CANMessageDataCallback.


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