-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add RMW listener APIs add constness Use or discard previous events: Guard conditions Move parentheses Rename Event_callback to ExecutorEventCallback update name Add events support void return on set_events_executor_callback Revert "void return on set_events_executor_callback" Rename ExecutorEventCallback -> EventsExecutorCallback Rename set_events_executor_callback->set_listener_callback Use data types when setting callbacks Move rcutils/executor_event_types.h to rmw/ Add executor_event_types.h rename event types Rename executor_context->callback_context Add APIs documentation Modify doc Rename callback_context->user_data Reorder APIs arguments Add more info on set_listener_callback comments rename rmw_listener_cb_t->rmw_listener_callback_t Add missing comments use void * to pass executor ptr Rework executor callback data Use RMW renamed file Define publisher/subscription event types Signed-off-by: Alberto Soragna <asoragna@irobot.com> * Restore event data types Signed-off-by: Mauro Passerino <mpasserino@irobot.com> * remove event_data_type Signed-off-by: Mauro Passerino <mpasserino@irobot.com> * Remove use_previous_event Signed-off-by: Mauro Passerino <mpasserino@irobot.com> * Add num_events arg Signed-off-by: Mauro Passerino <mpasserino@irobot.com> * Remove guard condition listener Signed-off-by: Mauro Passerino <mpasserino@irobot.com> * refactor to remove listener term Signed-off-by: William Woodall <william@osrfoundation.org> Co-authored-by: Mauro <mpasserino@irobot.com> Co-authored-by: William Woodall <william@osrfoundation.org> Co-authored-by: Alberto Soragna <alberto.soragna@gmail.com>
- Loading branch information
1 parent
5c822d1
commit cebd22c
Showing
2 changed files
with
195 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// Copyright 2021 Open Source Robotics Foundation, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef RMW__EVENT_CALLBACK_TYPE_H_ | ||
#define RMW__EVENT_CALLBACK_TYPE_H_ | ||
|
||
#include <stddef.h> | ||
|
||
#ifdef __cplusplus | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
/// Common event callback type signature. | ||
/** | ||
* Event callbacks of this type can be called in various scenarios, e.g. | ||
* data becomes available on a subscription, a QoS event has occurred, or | ||
* something similar. | ||
* | ||
* The user_data argument is given by the user when registering the callback, | ||
* and is given back to the callback each time so it can have associated, | ||
* user-defined state. | ||
* | ||
* The number_of_events argument indicates the number of events since the | ||
* callback was called. | ||
* This is most often 1, but can be > 1 when events occur before the callback | ||
* is registered. | ||
* It should never be 0. | ||
* | ||
* \sa rmw_subscription_set_on_new_message_callback() | ||
* \sa rmw_service_set_on_new_request_callback() | ||
* \sa rmw_client_set_on_new_response_callback() | ||
* \sa rmw_event_set_callback() | ||
*/ | ||
typedef void (* rmw_event_callback_t)(const void * user_data, size_t number_of_events); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif // RMW__EVENT_CALLBACK_TYPE_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters