Class ReceiverResource

Inheritance Relationships

Base Type

Class Documentation

class ReceiverResource : public eprosima::fastdds::rtps::TransportReceiverInterface

RAII object that encapsulates the Receive operation over one channel in an unknown transport. A Receiver resource is always univocally associated to a transport channel; the act of constructing a Receiver Resource opens the channel and its destruction closes it.

Public Functions

virtual void OnDataReceived(const octet *data, const uint32_t size, const Locator_t &localLocator, const Locator_t &remoteLocator) override

Method called by the transport when receiving data.

Parameters
  • data – Pointer to the received data.

  • size – Number of bytes received.

  • localLocator – Locator identifying the local endpoint.

  • remoteLocator – Locator identifying the remote endpoint.

bool SupportsLocator(const Locator_t &localLocator)

Reports whether this resource supports the given local locator (i.e., said locator maps to the transport channel managed by this resource).

void RegisterReceiver(MessageReceiver *receiver)

Register a MessageReceiver object to be called upon reception of data.

Parameters

receiver – The message receiver to register.

void UnregisterReceiver(MessageReceiver *receiver)

Unregister a MessageReceiver object to be called upon reception of data.

Parameters

receiver – The message receiver to unregister.

void disable()

Closes related ChannelResources.

inline uint32_t max_message_size() const
ReceiverResource(ReceiverResource&&)

Resources can only be transfered through move semantics. Copy, assignment, and construction outside of the factory are forbidden.

~ReceiverResource() override