nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
Loading...
Searching...
No Matches
rclcpp::Publisher< M >::Loan Class Reference

#include <publisher.hpp>

Public Member Functions

size_t capacity () const
Result commit (size_t actual_len)
 Send actual_len bytes. Consumes the loan.
uint8_t * data ()
 Writable view of the loaned bytes.
const uint8_t * data () const
Result discard ()
 Abandon without sending. Consumes the loan.
bool is_valid () const
 Loan ()
 Loan (const Loan &)=delete
 Loan (Loan &&o)
 Loan (void *pub, uint8_t *buf, size_t cap, void *token)
Loan & operator= (const Loan &)=delete
Loan & operator= (Loan &&o)
 ~Loan ()

Detailed Description

template<typename M>
class rclcpp::Publisher< M >::Loan

Phase 124.A.7 — writable slot returned by Publisher::loan. RAII: commit(actual_len) sends + consumes; discard() abandons + consumes; Drop without either calls discard automatically.

Constructor & Destructor Documentation

◆ Loan() [1/4]

template<typename M>
rclcpp::Publisher< M >::Loan::Loan ( )
inline

◆ Loan() [2/4]

template<typename M>
rclcpp::Publisher< M >::Loan::Loan ( Loan && o)
inline

◆ Loan() [3/4]

template<typename M>
rclcpp::Publisher< M >::Loan::Loan ( const Loan & )
delete

◆ ~Loan()

template<typename M>
rclcpp::Publisher< M >::Loan::~Loan ( )
inline

◆ Loan() [4/4]

template<typename M>
rclcpp::Publisher< M >::Loan::Loan ( void * pub,
uint8_t * buf,
size_t cap,
void * token )
inline

Internal constructor — callers use Publisher::loan() not this directly.

Member Function Documentation

◆ capacity()

template<typename M>
size_t rclcpp::Publisher< M >::Loan::capacity ( ) const
inline

◆ commit()

template<typename M>
Result rclcpp::Publisher< M >::Loan::commit ( size_t actual_len)
inline

Send actual_len bytes. Consumes the loan.

◆ data() [1/2]

template<typename M>
uint8_t * rclcpp::Publisher< M >::Loan::data ( )
inline

Writable view of the loaned bytes.

◆ data() [2/2]

template<typename M>
const uint8_t * rclcpp::Publisher< M >::Loan::data ( ) const
inline

◆ discard()

template<typename M>
Result rclcpp::Publisher< M >::Loan::discard ( )
inline

Abandon without sending. Consumes the loan.

◆ is_valid()

template<typename M>
bool rclcpp::Publisher< M >::Loan::is_valid ( ) const
inline

◆ operator=() [1/2]

template<typename M>
Loan & rclcpp::Publisher< M >::Loan::operator= ( const Loan & )
delete

◆ operator=() [2/2]

template<typename M>
Loan & rclcpp::Publisher< M >::Loan::operator= ( Loan && o)
inline

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