Class SenderResource
Defined in File SenderResource.hpp
Class Documentation
-
class SenderResource
RAII object that encapsulates the Send operation over one chanel in an unknown transport. A Sender resource is always univocally associated to a transport channel; the act of constructing a Sender Resource opens the channel and its destruction closes it.
Public Types
-
using NetworkBuffer = eprosima::fastdds::rtps::NetworkBuffer
Public Functions
-
inline bool send(const std::vector<NetworkBuffer> &buffers, const uint32_t &total_bytes, LocatorsIterator *destination_locators_begin, LocatorsIterator *destination_locators_end, const std::chrono::steady_clock::time_point &max_blocking_time_point)
Sends to a destination locator, through the channel managed by this resource.
- Parameters:
buffers – Vector of buffers to send.
total_bytes – Length of all buffers to be sent. Will be used as a boundary for the previous parameter.
destination_locators_begin – destination endpoint Locators iterator begin.
destination_locators_end – destination endpoint Locators iterator end.
max_blocking_time_point – If transport supports it then it will use it as maximum blocking time.
- Returns:
Success of the send operation.
-
inline SenderResource(SenderResource &&rValueResource)
Resources can only be transfered through move semantics. Copy, assignment, and construction outside of the factory are forbidden.
-
virtual ~SenderResource() = default
-
inline int32_t kind() const
-
inline virtual void add_locators_to_list(LocatorList_t &locators) const
Add locators representing the local endpoints managed by this sender resource.
- Parameters:
locators – [inout] List where locators will be added.
Protected Functions
-
inline SenderResource(int32_t transport_kind)
Protected Attributes
-
int32_t transport_kind_
-
std::function<void()> clean_up
-
std::function<bool(const std::vector<NetworkBuffer>&, uint32_t, LocatorsIterator *destination_locators_begin, LocatorsIterator *destination_locators_end, const std::chrono::steady_clock::time_point&)> send_buffers_lambda_
-
using NetworkBuffer = eprosima::fastdds::rtps::NetworkBuffer