Fast DDS  Version 3.6.1.0
Fast DDS
IPayloadPool.hpp
1 // Copyright 2020 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 
19 #ifndef FASTDDS_RTPS_HISTORY__IPAYLOADPOOL_HPP
20 #define FASTDDS_RTPS_HISTORY__IPAYLOADPOOL_HPP
21 
22 #include <cstdint>
23 #include <memory>
24 
25 namespace eprosima {
26 namespace fastdds {
27 namespace rtps {
28 
29 struct SerializedPayload_t;
30 
35 {
36 public:
37 
38  virtual ~IPayloadPool() = default;
39 
59  virtual bool get_payload(
60  uint32_t size,
61  SerializedPayload_t& payload) = 0;
62 
85  virtual bool get_payload(
86  const SerializedPayload_t& data,
87  SerializedPayload_t& payload) = 0;
88 
102  virtual bool release_payload(
103  SerializedPayload_t& payload) = 0;
104 };
105 
106 } // namespace rtps
107 } // namespace fastdds
108 } // namespace eprosima
109 
110 
111 #endif // FASTDDS_RTPS_HISTORY__IPAYLOADPOOL_HPP
An interface for classes responsible of serialized payload management.
Definition: IPayloadPool.hpp:35
virtual bool get_payload(const SerializedPayload_t &data, SerializedPayload_t &payload)=0
Assign a serialized payload to a new sample.
virtual bool get_payload(uint32_t size, SerializedPayload_t &payload)=0
Get a serialized payload for a new sample.
virtual bool release_payload(SerializedPayload_t &payload)=0
Release a serialized payload from a sample.
Structure SerializedPayload_t.
Definition: SerializedPayload.hpp:59