iceoryx_doc  1.0.1
listener.h
1 // Copyright (c) 2021 Apex.AI Inc. 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 
17 #ifndef IOX_BINDING_C_LISTENER_H
18 #define IOX_BINDING_C_LISTENER_H
19 
20 #include "iceoryx_binding_c/enums.h"
21 #include "iceoryx_binding_c/internal/c2cpp_binding.h"
22 #include "iceoryx_binding_c/subscriber.h"
23 #include "iceoryx_binding_c/types.h"
24 #include "iceoryx_binding_c/user_trigger.h"
25 
26 typedef CLASS Listener* iox_listener_t;
27 
28 
32 iox_listener_t iox_listener_init(iox_listener_storage_t* self);
33 
36 void iox_listener_deinit(iox_listener_t const self);
37 
44 ENUM iox_ListenerResult iox_listener_attach_subscriber_event(iox_listener_t const self,
45  iox_sub_t const subscriber,
46  const ENUM iox_SubscriberEvent subscriberEvent,
47  void (*callback)(iox_sub_t));
48 
57 ENUM iox_ListenerResult
58 iox_listener_attach_subscriber_event_with_context_data(iox_listener_t const self,
59  iox_sub_t const subscriber,
60  const ENUM iox_SubscriberEvent subscriberEvent,
61  void (*callback)(iox_sub_t, void*),
62  void* const contextData);
63 
69 ENUM iox_ListenerResult iox_listener_attach_user_trigger_event(iox_listener_t const self,
70  iox_user_trigger_t const userTrigger,
71  void (*callback)(iox_user_trigger_t));
72 
80 ENUM iox_ListenerResult iox_listener_attach_user_trigger_event_with_context_data(iox_listener_t const self,
81  iox_user_trigger_t const userTrigger,
82  void (*callback)(iox_user_trigger_t,
83  void*),
84  void* const contextData);
85 
90 void iox_listener_detach_subscriber_event(iox_listener_t const self,
91  iox_sub_t const subscriber,
92  const ENUM iox_SubscriberEvent subscriberEvent);
93 
97 void iox_listener_detach_user_trigger_event(iox_listener_t const self, iox_user_trigger_t const userTrigger);
98 
99 
103 uint64_t iox_listener_size(iox_listener_t const self);
104 
108 uint64_t iox_listener_capacity(iox_listener_t const self);
109 
110 #endif
Definition: cpp2c_subscriber.hpp:28
Definition: types.h:75