AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
|
A class that represents data of a CAN message by holding a view of an array of bytes. The view is not owned by this class, it is simply holding a pointer to the array of bytes. More...
#include <can_message_data.hpp>
Public Member Functions | |
CANMessageDataView (const std::uint8_t *ptr, std::size_t len) | |
Construct a new CANMessageDataView object. | |
std::size_t | size () const override |
Get the size of the data. | |
std::uint8_t | get_byte (std::size_t index) override |
Get the byte at the given index. | |
CANDataSpan | data () const |
Get the data span. | |
std::unique_ptr< CANMessageData > | copy_if_not_owned (std::unique_ptr< CANMessageData > self) const override |
If the data isn't owned by this class, make a copy of the data. | |
Public Member Functions inherited from isobus::CANMessageData | |
virtual | ~CANMessageData ()=default |
Default destructor. | |
A class that represents data of a CAN message by holding a view of an array of bytes. The view is not owned by this class, it is simply holding a pointer to the array of bytes.
Definition at line 90 of file can_message_data.hpp.
isobus::CANMessageDataView::CANMessageDataView | ( | const std::uint8_t * | ptr, |
std::size_t | len ) |
Construct a new CANMessageDataView object.
[in] | ptr | The pointer to the array of bytes. |
[in] | len | The length of the array of bytes. |
Definition at line 57 of file can_message_data.cpp.
|
overridevirtual |
If the data isn't owned by this class, make a copy of the data.
[in] | self | A pointer to this object. |
Implements isobus::CANMessageData.
Definition at line 77 of file can_message_data.cpp.
CANDataSpan isobus::CANMessageDataView::data | ( | ) | const |
|
overridevirtual |
Get the byte at the given index.
[in] | index | The index of the byte to get. |
Implements isobus::CANMessageData.
Definition at line 67 of file can_message_data.cpp.
|
overridevirtual |
Get the size of the data.
Implements isobus::CANMessageData.
Definition at line 62 of file can_message_data.cpp.