.. _program_listing_file_include_rmw_types.h: Program Listing for File types.h ================================ |exhale_lsh| :ref:`Return to documentation for file ` (``include/rmw/types.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp // Copyright 2014-2017 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__TYPES_H_ #define RMW__TYPES_H_ #ifdef __cplusplus extern "C" { #endif #include #include #include // map rcutils specific log levels to rmw speicfic type #include #include "rmw/events_statuses/events_statuses.h" #include "rmw/init.h" #include "rmw/init_options.h" #include "rmw/ret_types.h" #include "rmw/security_options.h" #include "rmw/serialized_message.h" #include "rmw/subscription_content_filter_options.h" #include "rmw/time.h" #include "rmw/visibility_control.h" // We define the GID as 16 bytes (128 bits). This should be enough to ensure // uniqueness amongst all entities in the system. It is up to the individual // RMW implementations to fill that in, either from the underlying middleware // or from the RMW layer itself. #define RMW_GID_STORAGE_SIZE 16u typedef struct RMW_PUBLIC_TYPE rmw_node_s { const char * implementation_identifier; void * data; const char * name; const char * namespace_; rmw_context_t * context; } rmw_node_t; typedef enum RMW_PUBLIC_TYPE rmw_endpoint_type_e { RMW_ENDPOINT_INVALID = 0, RMW_ENDPOINT_PUBLISHER, RMW_ENDPOINT_SUBSCRIPTION } rmw_endpoint_type_t; typedef enum RMW_PUBLIC_TYPE rmw_unique_network_flow_endpoints_requirement_e { RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_NOT_REQUIRED = 0, RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_STRICTLY_REQUIRED, RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_OPTIONALLY_REQUIRED, RMW_UNIQUE_NETWORK_FLOW_ENDPOINTS_SYSTEM_DEFAULT } rmw_unique_network_flow_endpoints_requirement_t; typedef struct RMW_PUBLIC_TYPE rmw_publisher_options_s { void * rmw_specific_publisher_payload; rmw_unique_network_flow_endpoints_requirement_t require_unique_network_flow_endpoints; } rmw_publisher_options_t; typedef struct RMW_PUBLIC_TYPE rmw_publisher_s { const char * implementation_identifier; void * data; const char * topic_name; rmw_publisher_options_t options; bool can_loan_messages; } rmw_publisher_t; typedef struct RMW_PUBLIC_TYPE rmw_subscription_options_s { void * rmw_specific_subscription_payload; bool ignore_local_publications; rmw_unique_network_flow_endpoints_requirement_t require_unique_network_flow_endpoints; rmw_subscription_content_filter_options_t * content_filter_options; } rmw_subscription_options_t; typedef struct RMW_PUBLIC_TYPE rmw_subscription_s { const char * implementation_identifier; void * data; const char * topic_name; rmw_subscription_options_t options; bool can_loan_messages; bool is_cft_enabled; } rmw_subscription_t; typedef struct RMW_PUBLIC_TYPE rmw_service_s { const char * implementation_identifier; void * data; const char * service_name; } rmw_service_t; typedef struct RMW_PUBLIC_TYPE rmw_client_s { const char * implementation_identifier; void * data; const char * service_name; } rmw_client_t; typedef struct RMW_PUBLIC_TYPE rmw_guard_condition_s { const char * implementation_identifier; void * data; rmw_context_t * context; } rmw_guard_condition_t; typedef struct RMW_PUBLIC_TYPE rmw_publisher_allocation_s { const char * implementation_identifier; void * data; } rmw_publisher_allocation_t; typedef struct RMW_PUBLIC_TYPE rmw_subscription_allocation_s { const char * implementation_identifier; void * data; } rmw_subscription_allocation_t; typedef struct RMW_PUBLIC_TYPE rmw_subscriptions_s { size_t subscriber_count; void ** subscribers; } rmw_subscriptions_t; typedef struct RMW_PUBLIC_TYPE rmw_services_s { size_t service_count; void ** services; } rmw_services_t; typedef struct RMW_PUBLIC_TYPE rmw_clients_s { size_t client_count; void ** clients; } rmw_clients_t; typedef struct RMW_PUBLIC_TYPE rmw_events_s { size_t event_count; void ** events; } rmw_events_t; typedef struct RMW_PUBLIC_TYPE rmw_guard_conditions_s { size_t guard_condition_count; void ** guard_conditions; } rmw_guard_conditions_t; typedef struct RMW_PUBLIC_TYPE rmw_wait_set_s { const char * implementation_identifier; rmw_guard_conditions_t * guard_conditions; void * data; } rmw_wait_set_t; typedef struct RMW_PUBLIC_TYPE rmw_request_id_s { uint8_t writer_guid[RMW_GID_STORAGE_SIZE]; int64_t sequence_number; } rmw_request_id_t; typedef struct RMW_PUBLIC_TYPE rmw_service_info_s { rmw_time_point_value_t source_timestamp; rmw_time_point_value_t received_timestamp; rmw_request_id_t request_id; } rmw_service_info_t; typedef enum RMW_PUBLIC_TYPE rmw_qos_reliability_policy_e { RMW_QOS_POLICY_RELIABILITY_SYSTEM_DEFAULT, RMW_QOS_POLICY_RELIABILITY_RELIABLE, RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT, RMW_QOS_POLICY_RELIABILITY_UNKNOWN, RMW_QOS_POLICY_RELIABILITY_BEST_AVAILABLE } rmw_qos_reliability_policy_t; typedef enum RMW_PUBLIC_TYPE rmw_qos_history_policy_e { RMW_QOS_POLICY_HISTORY_SYSTEM_DEFAULT, RMW_QOS_POLICY_HISTORY_KEEP_LAST, RMW_QOS_POLICY_HISTORY_KEEP_ALL, RMW_QOS_POLICY_HISTORY_UNKNOWN } rmw_qos_history_policy_t; typedef enum RMW_PUBLIC_TYPE rmw_qos_durability_policy_e { RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT, RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL, RMW_QOS_POLICY_DURABILITY_VOLATILE, RMW_QOS_POLICY_DURABILITY_UNKNOWN, RMW_QOS_POLICY_DURABILITY_BEST_AVAILABLE } rmw_qos_durability_policy_t; #define RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE_DEPRECATED_MSG \ "RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE is deprecated. " \ "Use RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC if manually asserted liveliness is needed." #ifndef _WIN32 # define RMW_DECLARE_DEPRECATED(name, msg) name __attribute__((deprecated(msg))) #else # define RMW_DECLARE_DEPRECATED(name, msg) name __pragma(deprecated(name)) #endif // Suppress syntax errors, as cppcheck does not seem to handle enumerator attributes. // cppcheck-suppress syntaxError typedef enum RMW_PUBLIC_TYPE rmw_qos_liveliness_policy_e { RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT = 0, RMW_QOS_POLICY_LIVELINESS_AUTOMATIC = 1, RMW_DECLARE_DEPRECATED( RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE, RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_NODE_DEPRECATED_MSG) = 2, // Using `3` for backwards compatibility. RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC = 3, RMW_QOS_POLICY_LIVELINESS_UNKNOWN = 4, RMW_QOS_POLICY_LIVELINESS_BEST_AVAILABLE = 5 } rmw_qos_liveliness_policy_t; #define RMW_QOS_DEADLINE_DEFAULT RMW_DURATION_UNSPECIFIED #define RMW_QOS_DEADLINE_BEST_AVAILABLE {9223372036LL, 854775806LL} #define RMW_QOS_LIFESPAN_DEFAULT RMW_DURATION_UNSPECIFIED #define RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT RMW_DURATION_UNSPECIFIED #define RMW_QOS_LIVELINESS_LEASE_DURATION_BEST_AVAILABLE {9223372036LL, 854775806LL} typedef struct RMW_PUBLIC_TYPE rmw_qos_profile_s { enum rmw_qos_history_policy_e history; size_t depth; enum rmw_qos_reliability_policy_e reliability; enum rmw_qos_durability_policy_e durability; struct rmw_time_s deadline; struct rmw_time_s lifespan; enum rmw_qos_liveliness_policy_e liveliness; struct rmw_time_s liveliness_lease_duration; bool avoid_ros_namespace_conventions; } rmw_qos_profile_t; typedef struct RMW_PUBLIC_TYPE rmw_gid_s { const char * implementation_identifier; uint8_t data[RMW_GID_STORAGE_SIZE]; } rmw_gid_t; #define RMW_MESSAGE_INFO_SEQUENCE_NUMBER_UNSUPPORTED UINT64_MAX typedef struct RMW_PUBLIC_TYPE rmw_message_info_s { rmw_time_point_value_t source_timestamp; rmw_time_point_value_t received_timestamp; uint64_t publication_sequence_number; uint64_t reception_sequence_number; rmw_gid_t publisher_gid; bool from_intra_process; } rmw_message_info_t; RMW_PUBLIC RMW_WARN_UNUSED rmw_message_info_t rmw_get_zero_initialized_message_info(void); enum {RMW_QOS_POLICY_DEPTH_SYSTEM_DEFAULT = 0}; typedef enum RMW_PUBLIC_TYPE { RMW_LOG_SEVERITY_DEBUG = RCUTILS_LOG_SEVERITY_DEBUG, RMW_LOG_SEVERITY_INFO = RCUTILS_LOG_SEVERITY_INFO, RMW_LOG_SEVERITY_WARN = RCUTILS_LOG_SEVERITY_WARN, RMW_LOG_SEVERITY_ERROR = RCUTILS_LOG_SEVERITY_ERROR, RMW_LOG_SEVERITY_FATAL = RCUTILS_LOG_SEVERITY_FATAL } rmw_log_severity_t; #ifdef __cplusplus } #endif #endif // RMW__TYPES_H_