iceoryx_doc  1.0.1
sample_deleter.hpp
1 // Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
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 //
15 // SPDX-License-Identifier: Apache-2.0
16 
17 #ifndef IOX_POSH_POPO_SAMPLE_DELETER_HPP
18 #define IOX_POSH_POPO_SAMPLE_DELETER_HPP
19 
20 #include "iceoryx_posh/mepoo/chunk_header.hpp"
21 
22 namespace iox
23 {
24 namespace popo
25 {
31 
32 template <typename Port>
34 {
35  public:
36  SampleDeleter(Port& port);
37 
40  template <typename T>
41  void operator()(T* const userPayload);
42 
45  template <typename T>
46  void operator()(const T* const userPayload) const;
47 
48  private:
49  Port* m_port;
50 };
51 
52 } // namespace popo
53 } // namespace iox
54 
55 #include "iceoryx_posh/internal/popo/sample_deleter.inl"
56 
57 #endif // IOX_POSH_POPO_SAMPLE_DELETER_HPP
Definition: service_description.hpp:29
The SampleDeleter struct is a custom deleter in functor form which releases loans to a sample's under...
Definition: sample_deleter.hpp:34
void operator()(T *const userPayload)
Handles deletion of the sample.
Definition: sample_deleter.inl:34