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::CANMessageDataVector Class Reference

A class that represents data of a CAN message by holding a vector of bytes. More...

#include <can_message_data.hpp>

Inheritance diagram for isobus::CANMessageDataVector:
[legend]
Collaboration diagram for isobus::CANMessageDataVector:
[legend]

Public Member Functions

 CANMessageDataVector (std::size_t size)
 Construct a new CANMessageDataVector object.
 
 CANMessageDataVector (const std::vector< std::uint8_t > &data)
 Construct a new CANMessageDataVector object.
 
 CANMessageDataVector (const std::uint8_t *data, std::size_t size)
 Construct a new CANMessageDataVector 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.
 
void set_byte (std::size_t index, std::uint8_t value)
 Set the byte at the given index.
 
CANDataSpan data () const
 Get the data span.
 
std::unique_ptr< CANMessageDatacopy_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.
 

Detailed Description

A class that represents data of a CAN message by holding a vector of bytes.

Definition at line 47 of file can_message_data.hpp.

Constructor & Destructor Documentation

◆ CANMessageDataVector() [1/3]

isobus::CANMessageDataVector::CANMessageDataVector ( std::size_t size)
explicit

Construct a new CANMessageDataVector object.

Parameters
[in]sizeThe size of the data.

Definition at line 16 of file can_message_data.cpp.

Here is the call graph for this function:

◆ CANMessageDataVector() [2/3]

isobus::CANMessageDataVector::CANMessageDataVector ( const std::vector< std::uint8_t > & data)
explicit

Construct a new CANMessageDataVector object.

Parameters
[in]dataThe data to copy.

Definition at line 21 of file can_message_data.cpp.

Here is the call graph for this function:

◆ CANMessageDataVector() [3/3]

isobus::CANMessageDataVector::CANMessageDataVector ( const std::uint8_t * data,
std::size_t size )

Construct a new CANMessageDataVector object.

Parameters
[in]dataA pointer to the data to copy.
[in]sizeThe size of the data to copy.

Definition at line 26 of file can_message_data.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ copy_if_not_owned()

std::unique_ptr< CANMessageData > isobus::CANMessageDataVector::copy_if_not_owned ( std::unique_ptr< CANMessageData > self) const
overridevirtual

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 it returns itself.

Implements isobus::CANMessageData.

Definition at line 51 of file can_message_data.cpp.

◆ data()

CANDataSpan isobus::CANMessageDataVector::data ( ) const

Get the data span.

Returns
The data span.

Definition at line 46 of file can_message_data.cpp.

Here is the caller graph for this function:

◆ get_byte()

std::uint8_t isobus::CANMessageDataVector::get_byte ( std::size_t index)
overridevirtual

Get the byte at the given index.

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

Implements isobus::CANMessageData.

Definition at line 36 of file can_message_data.cpp.

◆ set_byte()

void isobus::CANMessageDataVector::set_byte ( std::size_t index,
std::uint8_t value )

Set the byte at the given index.

Parameters
[in]indexThe index of the byte to set.
[in]valueThe value to set the byte to.

Definition at line 41 of file can_message_data.cpp.

Here is the caller graph for this function:

◆ size()

std::size_t isobus::CANMessageDataVector::size ( ) const
overridevirtual

Get the size of the data.

Returns
The size of the data.

Implements isobus::CANMessageData.

Definition at line 31 of file can_message_data.cpp.

Here is the caller graph for this function:

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