iceoryx_doc  1.0.1
interface_port.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_POPO_PORTS_INTERFACE_PORT_HPP
17 #define IOX_POSH_POPO_PORTS_INTERFACE_PORT_HPP
18 
19 #include "iceoryx_posh/iceoryx_posh_types.hpp"
20 #include "iceoryx_posh/internal/popo/ports/base_port.hpp"
21 #include "iceoryx_posh/internal/popo/ports/interface_port_data.hpp"
22 
23 namespace iox
24 {
25 namespace popo
26 {
27 class InterfacePort : public BasePort
28 {
29  public:
30  explicit InterfacePort(InterfacePortData* const interfacePortDataPtr) noexcept;
31 
32  InterfacePort(const InterfacePort& other) = delete;
33  InterfacePort& operator=(const InterfacePort& other) = delete;
34  InterfacePort(InterfacePort&& other) = default;
35  InterfacePort& operator=(InterfacePort&& other) = default;
36  ~InterfacePort() = default;
37 
40  cxx::optional<capro::CaproMessage> tryGetCaProMessage() noexcept;
41 
44  void dispatchCaProMessage(const capro::CaproMessage& caProMessage) noexcept;
45 
46  private:
47  const InterfacePortData* getMembers() const noexcept;
48  InterfacePortData* getMembers() noexcept;
49 };
50 
51 } // namespace popo
52 } // namespace iox
53 
54 #endif // IOX_POSH_POPO_PORTS_INTERFACE_PORT_HPP
this class is the base for all ports. it is constructed from a member pointer and is only movable....
Definition: base_port.hpp:43
Definition: interface_port.hpp:28
void dispatchCaProMessage(const capro::CaproMessage &caProMessage) noexcept
dispatch a CaPro message to this interface port
cxx::optional< capro::CaproMessage > tryGetCaProMessage() noexcept
get an optional CaPro message for the interface port to process
Definition: service_description.hpp:29
Definition: interface_port_data.hpp:30