iceoryx_doc  1.0.1
client_port_roudi.hpp
1 // Copyright (c) 2020 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_CLIENT_PORT_ROUDI_HPP
17 #define IOX_POSH_POPO_PORTS_CLIENT_PORT_ROUDI_HPP
18 
19 #include "iceoryx_posh/internal/capro/capro_message.hpp"
20 #include "iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp"
21 #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp"
22 #include "iceoryx_posh/internal/popo/ports/base_port.hpp"
23 #include "iceoryx_posh/internal/popo/ports/client_port_data.hpp"
24 #include "iceoryx_utils/cxx/optional.hpp"
25 
26 namespace iox
27 {
28 namespace popo
29 {
34 class ClientPortRouDi : public BasePort
35 {
36  public:
38 
39  explicit ClientPortRouDi(cxx::not_null<MemberType_t* const> clientPortDataPtr) noexcept;
40 
41  ClientPortRouDi(const ClientPortRouDi& other) = delete;
42  ClientPortRouDi& operator=(const ClientPortRouDi&) = delete;
43  ClientPortRouDi(ClientPortRouDi&& rhs) = default;
44  ClientPortRouDi& operator=(ClientPortRouDi&& rhs) = default;
45  ~ClientPortRouDi() = default;
46 
49  cxx::optional<capro::CaproMessage> tryGetCaProMessage() noexcept;
50 
54  cxx::optional<capro::CaproMessage>
55  dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMessage& caProMessage) noexcept;
56 
59  void releaseAllChunks() noexcept;
60 
61  private:
62  const MemberType_t* getMembers() const noexcept;
63  MemberType_t* getMembers() noexcept;
64 
65  ChunkSender<ClientChunkSenderData_t> m_chunkSender;
67 };
68 
69 } // namespace popo
70 } // namespace iox
71 
72 #endif // IOX_POSH_POPO_PORTS_CLIENT_PORT_ROUDI_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
The ChunkReceiver is a building block of the shared memory communication infrastructure....
Definition: chunk_receiver.hpp:46
The ChunkSender is a building block of the shared memory communication infrastructure....
Definition: chunk_sender.hpp:49
The ClientPortRouDi provides the API for accessing a client port from the RouDi middleware daemon sid...
Definition: client_port_roudi.hpp:35
cxx::optional< capro::CaproMessage > tryGetCaProMessage() noexcept
get an optional CaPro message that requests changes to the desired connection state of the client
cxx::optional< capro::CaproMessage > dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMessage &caProMessage) noexcept
dispatch a CaPro message to the client for processing
void releaseAllChunks() noexcept
cleanup the client and release all the chunks it currently holds Caution: Contract is that user proce...
Definition: service_description.hpp:29
Defines different base port data.
Definition: base_port_data.hpp:34
Definition: client_port_data.hpp:34