Class SenderResource

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 Functions

inline bool send(const octet *data, uint32_t dataLength, 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
  • data – Raw data slice to be sent.

  • dataLength – Length of the data 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 octet*, uint32_t, LocatorsIterator *destination_locators_begin, LocatorsIterator *destination_locators_end, const std::chrono::steady_clock::time_point&)> send_lambda_