iceoryx_doc  1.0.1
server_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_SERVER_PORT_ROUDI_HPP
17 #define IOX_POSH_POPO_PORTS_SERVER_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/server_port_data.hpp"
24 #include "iceoryx_utils/cxx/optional.hpp"
25 
26 namespace iox
27 {
28 namespace popo
29 {
34 class ServerPortRouDi : public BasePort
35 {
36  public:
38 
39  explicit ServerPortRouDi(cxx::not_null<MemberType_t* const> serverPortDataPtr) noexcept;
40 
41  ServerPortRouDi(const ServerPortRouDi& other) = delete;
42  ServerPortRouDi& operator=(const ServerPortRouDi&) = delete;
43  ServerPortRouDi(ServerPortRouDi&& rhs) = default;
44  ServerPortRouDi& operator=(ServerPortRouDi&& rhs) = default;
45  ~ServerPortRouDi() = 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<ServerChunkSenderData_t> m_chunkSender;
67 };
68 
69 } // namespace popo
70 } // namespace iox
71 
72 #endif // IOX_POSH_POPO_PORTS_SERVER_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 ServerPortRouDi provides the API for accessing a server port from the RouDi middleware daemon sid...
Definition: server_port_roudi.hpp:35
void releaseAllChunks() noexcept
cleanup the server and release all the chunks it currently holds Caution: Contract is that user proce...
cxx::optional< capro::CaproMessage > tryGetCaProMessage() noexcept
get an optional CaPro message that changes the offer state of the server
cxx::optional< capro::CaproMessage > dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMessage &caProMessage) noexcept
dispatch a CaPro message to the server for processing
Definition: service_description.hpp:29
Defines different base port data.
Definition: base_port_data.hpp:34
Definition: server_port_data.hpp:34