Program Listing for File subscription.h
↰ Return to documentation for file (include/rcl/subscription.h
)
// Copyright 2015 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 RCL__SUBSCRIPTION_H_
#define RCL__SUBSCRIPTION_H_
#ifdef __cplusplus
extern "C"
{
#endif
#include "rosidl_runtime_c/message_type_support_struct.h"
#include "rcl/event_callback.h"
#include "rcl/macros.h"
#include "rcl/node.h"
#include "rcl/visibility_control.h"
#include "rmw/dynamic_message_type_support.h"
#include "rmw/message_sequence.h"
typedef struct rcl_subscription_impl_s rcl_subscription_impl_t;
typedef struct rcl_subscription_s
{
rcl_subscription_impl_t * impl;
} rcl_subscription_t;
typedef struct rcl_subscription_options_s
{
rmw_qos_profile_t qos;
rcl_allocator_t allocator;
rmw_subscription_options_t rmw_subscription_options;
bool disable_loaned_message;
} rcl_subscription_options_t;
typedef struct rcl_subscription_content_filter_options_s
{
rmw_subscription_content_filter_options_t rmw_subscription_content_filter_options;
} rcl_subscription_content_filter_options_t;
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_subscription_t
rcl_get_zero_initialized_subscription(void);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_init(
rcl_subscription_t * subscription,
const rcl_node_t * node,
const rosidl_message_type_support_t * type_support,
const char * topic_name,
const rcl_subscription_options_t * options
);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_fini(rcl_subscription_t * subscription, rcl_node_t * node);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_subscription_options_t
rcl_subscription_get_default_options(void);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_options_fini(rcl_subscription_options_t * option);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_options_set_content_filter_options(
const char * filter_expression,
size_t expression_parameters_argc,
const char * expression_parameter_argv[],
rcl_subscription_options_t * options);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_subscription_content_filter_options_t
rcl_get_zero_initialized_subscription_content_filter_options(void);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_content_filter_options_init(
const rcl_subscription_t * subscription,
const char * filter_expression,
size_t expression_parameters_argc,
const char * expression_parameter_argv[],
rcl_subscription_content_filter_options_t * options);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_content_filter_options_set(
const rcl_subscription_t * subscription,
const char * filter_expression,
size_t expression_parameters_argc,
const char * expression_parameter_argv[],
rcl_subscription_content_filter_options_t * options);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_content_filter_options_fini(
const rcl_subscription_t * subscription,
rcl_subscription_content_filter_options_t * options);
RCL_PUBLIC
RCL_WARN_UNUSED
bool
rcl_subscription_is_cft_enabled(const rcl_subscription_t * subscription);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_set_content_filter(
const rcl_subscription_t * subscription,
const rcl_subscription_content_filter_options_t * options
);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_get_content_filter(
const rcl_subscription_t * subscription,
rcl_subscription_content_filter_options_t * options
);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_take(
const rcl_subscription_t * subscription,
void * ros_message,
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation
);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_take_sequence(
const rcl_subscription_t * subscription,
size_t count,
rmw_message_sequence_t * message_sequence,
rmw_message_info_sequence_t * message_info_sequence,
rmw_subscription_allocation_t * allocation
);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_take_serialized_message(
const rcl_subscription_t * subscription,
rcl_serialized_message_t * serialized_message,
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_take_dynamic_message(
const rcl_subscription_t * subscription,
rosidl_dynamic_typesupport_dynamic_data_t * dynamic_message,
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_take_loaned_message(
const rcl_subscription_t * subscription,
void ** loaned_message,
rmw_message_info_t * message_info,
rmw_subscription_allocation_t * allocation);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_return_loaned_message_from_subscription(
const rcl_subscription_t * subscription,
void * loaned_message);
RCL_PUBLIC
RCL_WARN_UNUSED
const char *
rcl_subscription_get_topic_name(const rcl_subscription_t * subscription);
RCL_PUBLIC
RCL_WARN_UNUSED
const rcl_subscription_options_t *
rcl_subscription_get_options(const rcl_subscription_t * subscription);
RCL_PUBLIC
RCL_WARN_UNUSED
rmw_subscription_t *
rcl_subscription_get_rmw_handle(const rcl_subscription_t * subscription);
RCL_PUBLIC
bool
rcl_subscription_is_valid(const rcl_subscription_t * subscription);
RCL_PUBLIC
RCL_WARN_UNUSED
rmw_ret_t
rcl_subscription_get_publisher_count(
const rcl_subscription_t * subscription,
size_t * publisher_count);
RCL_PUBLIC
RCL_WARN_UNUSED
const rmw_qos_profile_t *
rcl_subscription_get_actual_qos(const rcl_subscription_t * subscription);
RCL_PUBLIC
bool
rcl_subscription_can_loan_messages(const rcl_subscription_t * subscription);
RCL_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_subscription_set_on_new_message_callback(
const rcl_subscription_t * subscription,
rcl_event_callback_t callback,
const void * user_data);
#ifdef __cplusplus
}
#endif
#endif // RCL__SUBSCRIPTION_H_