iceoryx_doc  1.0.1
gateway_base.hpp
1 // Copyright (c) 2019 by Robert Bosch GmbH. 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 #ifndef IOX_POSH_GW_GATEWAY_BASE_HPP
17 #define IOX_POSH_GW_GATEWAY_BASE_HPP
18 
19 #include "iceoryx_posh/capro/service_description.hpp"
20 #include "iceoryx_posh/iceoryx_posh_types.hpp"
21 #include "iceoryx_posh/internal/popo/ports/interface_port.hpp"
22 
23 #include <memory>
24 
25 namespace iox
26 {
27 namespace capro
28 {
29 class CaproMessage;
30 }
31 
32 namespace popo
33 {
34 class InterfacePort;
35 }
36 
37 namespace gw
38 {
41 {
42  public:
44 
47  GatewayBase(const capro::Interfaces f_interface) noexcept;
48 
49  GatewayBase& operator=(const GatewayBase& other) = delete;
50  GatewayBase(const GatewayBase& other) = delete;
51  GatewayBase(GatewayBase&& other) = default;
52  GatewayBase& operator=(GatewayBase&&) = default;
53 
54  virtual ~GatewayBase() noexcept;
57  bool getCaProMessage(CaproMessage& msg) noexcept;
58 
59  protected:
60  // Needed for unit testing
61  GatewayBase() noexcept = default;
62 
63  protected:
64  popo::InterfacePort m_interfaceImpl{nullptr};
65 };
66 
67 } // namespace gw
68 } // namespace iox
69 
70 #endif // IOX_POSH_GW_GATEWAY_BASE_HPP
C'tors for CaPro messages.
Definition: capro_message.hpp:60
Generic gateway for communication events.
Definition: gateway_base.hpp:41
GatewayBase(const capro::Interfaces f_interface) noexcept
Constructor for creating generic gateway based on type of interface.
bool getCaProMessage(CaproMessage &msg) noexcept
Get function for type of capro message - service or event or field.
Definition: service_description.hpp:29