nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
nros::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_tdata ()
 Writable view of the loaned bytes.
 
const uint8_tdata () 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)
 
Loanoperator= (const Loan &)=delete
 
Loanoperator= (Loan &&o)
 
 ~Loan ()
 

Detailed Description

template<typename M>
class nros::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 >
nros::Publisher< M >::Loan::Loan ( )
inline

◆ Loan() [2/4]

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

◆ Loan() [3/4]

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

◆ ~Loan()

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

◆ Loan() [4/4]

template<typename M >
nros::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 nros::Publisher< M >::Loan::capacity ( ) const
inline

◆ commit()

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

Send actual_len bytes. Consumes the loan.

◆ data() [1/2]

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

Writable view of the loaned bytes.

◆ data() [2/2]

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

◆ discard()

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

Abandon without sending. Consumes the loan.

◆ is_valid()

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

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