Fast DDS  Version 3.6.1.0
Fast DDS
TransportReceiverInterface.hpp
1 // Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
20 #ifndef FASTDDS_RTPS_TRANSPORT__TRANSPORTRECEIVERINTERFACE_HPP
21 #define FASTDDS_RTPS_TRANSPORT__TRANSPORTRECEIVERINTERFACE_HPP
22 
23 #include <fastdds/rtps/common/Locator.hpp>
24 
25 namespace eprosima {
26 namespace fastdds {
27 namespace rtps {
28 
33 class FASTDDS_EXPORTED_API TransportReceiverInterface
34 {
35 public:
36 
38  virtual ~TransportReceiverInterface() = default;
39 
47  virtual void OnDataReceived(
48  const fastdds::rtps::octet* data,
49  const uint32_t size,
50  const Locator& local_locator,
51  const Locator& remote_locator) = 0;
52 };
53 
54 } // namespace rtps
55 } // namespace fastdds
56 } // namespace eprosima
57 
58 #endif // FASTDDS_RTPS_TRANSPORT__TRANSPORTRECEIVERINTERFACE_HPP
Class Locator_t, uniquely identifies a communication channel for a particular transport.
Definition: Locator.hpp:74
Interface against which to implement a data receiver, decoupled from transport internals.
Definition: TransportReceiverInterface.hpp:34
virtual void OnDataReceived(const fastdds::rtps::octet *data, const uint32_t size, const Locator &local_locator, const Locator &remote_locator)=0
Method to be called by the transport when receiving data.
virtual ~TransportReceiverInterface()=default
Destructor.
uint8_t octet
Definition: Types.hpp:83