Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor #116 remove callback_type #154

Merged
merged 3 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rclc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ With `rclc_executor_trigger_any` being the default trigger condition, the curren
With the `rclc_executor_trigger_one` trigger, the handle to trigger is specified with `trigger_object`.
In the other cases of the trigger conditions this parameter shall be `NULL`.

**rclc_executor_add_subscription(rclc_executor_t * executor, rcl_subscription_t * subscription, void * msg, rclc_callback_t callback, rclc_executor_handle_invocation_t invocation)**
**rclc_executor_add_subscription(rclc_executor_t * executor, rcl_subscription_t * subscription, void * msg, rclc_subscription_callback_t callback, rclc_executor_handle_invocation_t invocation)**

**rclc_executor_add_timer( rclc_executor_t * executor, rcl_timer_t * timer)**

Expand Down
2 changes: 1 addition & 1 deletion rclc/include/rclc/executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ rclc_executor_add_subscription(
rclc_executor_t * executor,
rcl_subscription_t * subscription,
void * msg,
rclc_callback_t callback,
rclc_subscription_callback_t callback,
rclc_executor_handle_invocation_t invocation);

/**
Expand Down
29 changes: 13 additions & 16 deletions rclc/include/rclc/executor_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,17 @@ extern "C"
typedef enum
{
SUBSCRIPTION,
SUBSCRIPTION_WITH_CONTEXT,
TIMER,
// TIMER_WITH_CONTEXT, // TODO
CLIENT,
CLIENT_WITH_REQUEST_ID,
// CLIENT_WITH_CONTEXT, // TODO
SERVICE,
SERVICE_WITH_REQUEST_ID,
SERVICE_WITH_CONTEXT,
GUARD_CONDITION,
// GUARD_CONDITION_WITH_CONTEXT, //TODO
NONE
} rclc_executor_handle_type_t;

Expand All @@ -46,21 +53,13 @@ typedef enum
ALWAYS
} rclc_executor_handle_invocation_t;

typedef enum
{
CB_UNDEFINED,
CB_WITHOUT_REQUEST_ID,
CB_WITH_REQUEST_ID,
CB_WITH_CONTEXT,
} rclc_executor_handle_callback_type_t;


/// Type definition for callback function.
typedef void (* rclc_callback_t)(const void *);

/// Type definition for subscription callback function
/// - incoming message
// typedef void (* rclc_subscription_callback_t)(const void *);
typedef void (* rclc_subscription_callback_t)(const void *);

/// Type definition (duplicate) for subscription callback function (alias for foxy and galactic).
/// - incoming message
typedef rclc_subscription_callback_t rclc_callback_t;

/// Type definition for subscription callback function
/// - incoming message
Expand Down Expand Up @@ -137,7 +136,7 @@ typedef struct

/// Storage for callbacks
union {
rclc_callback_t callback;
rclc_subscription_callback_t subscription_callback;
rclc_subscription_callback_with_context_t subscription_callback_with_context;
rclc_service_callback_t service_callback;
rclc_service_callback_with_request_id_t service_callback_with_reqid;
Expand All @@ -159,8 +158,6 @@ typedef struct
/// Interval variable. Flag, which is true, if new data is available from DDS queue
/// (is set after calling rcl_take)
bool data_available;
/// callback type for service/client
rclc_executor_handle_callback_type_t callback_type;
} rclc_executor_handle_t;

/// Information about total number of subscriptions, guard_conditions, timers, subscription etc.
Expand Down
Loading