iceoryx_doc  1.0.1
cpp2c_subscriber.hpp
1 // Copyright (c) 2020 by Robert Bosch GmbH. All rights reserved.
2 // Copyright (c) 2020 - 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_BINDING_C_CPP2C_SUBSCRIBER_HPP
19 #define IOX_BINDING_C_CPP2C_SUBSCRIBER_HPP
20 
21 #include "iceoryx_binding_c/enums.h"
22 #include "iceoryx_posh/iceoryx_posh_types.hpp"
23 #include "iceoryx_posh/internal/popo/ports/subscriber_port_user.hpp"
24 #include "iceoryx_posh/popo/base_subscriber.hpp"
25 #include "iceoryx_posh/popo/wait_set.hpp"
26 
28 {
29  cpp2c_Subscriber() = default;
30  cpp2c_Subscriber(const cpp2c_Subscriber&) = delete;
31  cpp2c_Subscriber(cpp2c_Subscriber&& rhs) = delete;
33 
34  cpp2c_Subscriber& operator=(const cpp2c_Subscriber&) = delete;
35  cpp2c_Subscriber& operator=(cpp2c_Subscriber&& rhs) = delete;
36 
37  void enableEvent(iox::popo::TriggerHandle&& triggerHandle,
38  const iox::popo::SubscriberEvent subscriberEvent) noexcept;
39 
40  void disableEvent(const iox::popo::SubscriberEvent subscriberEvent) noexcept;
41 
42  void enableState(iox::popo::TriggerHandle&& triggerHandle,
43  const iox::popo::SubscriberState subscriberState) noexcept;
44 
45  void disableState(const iox::popo::SubscriberState subscriberState) noexcept;
46 
47  void invalidateTrigger(const uint64_t uniqueTriggerId) noexcept;
48 
49  bool hasSamples() const noexcept;
50 
51  iox::popo::WaitSetIsConditionSatisfiedCallback
52  getCallbackForIsStateConditionSatisfied(const iox::popo::SubscriberState subscriberState) const noexcept;
53 
54 
55  iox::popo::SubscriberPortData* m_portData{nullptr};
56  iox::popo::TriggerHandle m_trigger;
57 };
58 #endif
Definition: cpp2c_subscriber.hpp:28