iceoryx_doc  1.0.1
subscriber_port_roudi.hpp
1 // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2021 by Apex.AI Inc. All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // SPDX-License-Identifier: Apache-2.0
17 
18 #ifndef IOX_POPO_SUBSCRIBER_PORT_ROUDI_HPP_
19 #define IOX_POPO_SUBSCRIBER_PORT_ROUDI_HPP_
20 
21 #include "iceoryx_posh/internal/capro/capro_message.hpp"
22 #include "iceoryx_posh/internal/popo/building_blocks/chunk_receiver.hpp"
23 #include "iceoryx_posh/internal/popo/ports/base_port.hpp"
24 #include "iceoryx_posh/internal/popo/ports/subscriber_port_data.hpp"
25 #include "iceoryx_utils/cxx/optional.hpp"
26 
27 namespace iox
28 {
29 namespace popo
30 {
36 {
37  public:
39 
40  explicit SubscriberPortRouDi(cxx::not_null<MemberType_t* const> subscriberPortDataPtr) noexcept;
41 
42  SubscriberPortRouDi(const SubscriberPortRouDi& other) = delete;
43  SubscriberPortRouDi& operator=(const SubscriberPortRouDi&) = delete;
45  SubscriberPortRouDi& operator=(SubscriberPortRouDi&& rhs) = default;
46  virtual ~SubscriberPortRouDi() = default;
47 
50  QueueFullPolicy getQueueFullPolicy() const noexcept;
51 
54  virtual cxx::optional<capro::CaproMessage> tryGetCaProMessage() noexcept = 0;
55 
59  virtual cxx::optional<capro::CaproMessage>
60  dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMessage& caProMessage) noexcept = 0;
61 
64  void releaseAllChunks() noexcept;
65 
66  protected:
67  const MemberType_t* getMembers() const noexcept;
68  MemberType_t* getMembers() noexcept;
69 
70  ChunkReceiver<SubscriberPortData::ChunkReceiverData_t> m_chunkReceiver;
71 };
72 
73 } // namespace popo
74 } // namespace iox
75 
76 #endif
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 SubscriberPortRouDi provides the API for accessing a subscriber port from the RouDi middleware da...
Definition: subscriber_port_roudi.hpp:36
void releaseAllChunks() noexcept
cleanup the subscriber and release all the chunks it currently holds Caution: Contract is that user p...
virtual cxx::optional< capro::CaproMessage > dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMessage &caProMessage) noexcept=0
dispatch a CaPro message to the subscriber for processing
virtual cxx::optional< capro::CaproMessage > tryGetCaProMessage() noexcept=0
get an optional CaPro message that requests changes to the subscription state of the subscriber
QueueFullPolicy getQueueFullPolicy() const noexcept
Returns behaviour in case of a full delivery queue.
Definition: service_description.hpp:29
Defines different base port data.
Definition: base_port_data.hpp:34
Definition: subscriber_port_data.hpp:37