iceoryx_doc  1.0.1
publisher_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 #ifndef IOX_POSH_POPO_PORTS_PUBLISHER_PORT_ROUDI_HPP
18 #define IOX_POSH_POPO_PORTS_PUBLISHER_PORT_ROUDI_HPP
19 
20 #include "iceoryx_posh/internal/capro/capro_message.hpp"
21 #include "iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp"
22 #include "iceoryx_posh/internal/popo/building_blocks/chunk_sender.hpp"
23 #include "iceoryx_posh/internal/popo/ports/base_port.hpp"
24 #include "iceoryx_posh/internal/popo/ports/publisher_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 PublisherPortRouDi(cxx::not_null<MemberType_t* const> publisherPortDataPtr) noexcept;
41 
42  PublisherPortRouDi(const PublisherPortRouDi& other) = delete;
43  PublisherPortRouDi& operator=(const PublisherPortRouDi&) = delete;
44  PublisherPortRouDi(PublisherPortRouDi&& rhs) = default;
45  PublisherPortRouDi& operator=(PublisherPortRouDi&& rhs) = default;
46  ~PublisherPortRouDi() = default;
47 
50  SubscriberTooSlowPolicy getSubscriberTooSlowPolicy() const noexcept;
51 
54  cxx::optional<capro::CaproMessage> tryGetCaProMessage() noexcept;
55 
59  cxx::optional<capro::CaproMessage>
60  dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMessage& caProMessage) noexcept;
61 
64  void releaseAllChunks() noexcept;
65 
66  private:
67  const MemberType_t* getMembers() const noexcept;
68  MemberType_t* getMembers() noexcept;
69 
70  ChunkSender<PublisherPortData::ChunkSenderData_t> m_chunkSender;
71 };
72 
73 } // namespace popo
74 } // namespace iox
75 
76 #endif // IOX_POSH_POPO_PORTS_PUBLISHER_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 ChunkSender is a building block of the shared memory communication infrastructure....
Definition: chunk_sender.hpp:49
The PublisherPortRouDi provides the API for accessing a publisher port from the RouDi middleware daem...
Definition: publisher_port_roudi.hpp:36
void releaseAllChunks() noexcept
cleanup the publisher and release all the chunks it currently holds Caution: Contract is that user pr...
cxx::optional< capro::CaproMessage > tryGetCaProMessage() noexcept
get an optional CaPro message that changes the offer state of the publisher
cxx::optional< capro::CaproMessage > dispatchCaProMessageAndGetPossibleResponse(const capro::CaproMessage &caProMessage) noexcept
dispatch a CaPro message to the publisher for processing
SubscriberTooSlowPolicy getSubscriberTooSlowPolicy() 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: publisher_port_data.hpp:39