C++ API
rcutils: ROS 2 C Utilities data structures
rcutils
is a C API consisting of macros, functions, and data structures used through out the ROS 2 code base.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
API
The API is a combination of parts:
Allocator concept, used to inject the allocating and deallocating methods into a function or type.
rcutils_allocator_t
rcutils/allocator.h
Command line interface utilities:
rcutils/cmdline_parser.h
Utilities for setting error states (error message, file, and line number) like
strerror
forerrno
:rcutils/error_handling.h
Some basic filesystem utilities like checking for path existence, getting the cwd, etc…:
rcutils/filesystem.h
A C string find method:
rcutils/find.h
A convenient string formatting function, which takes a custom allocator:
rcutils/format_string.h
Functions for interfacing with process environment variables:
rcutils/env.h
Extensible logging macros:
Some examples (not exhaustive):
RCUTILS_LOG_DEBUG()
RCUTILS_LOG_INFO_NAMED()
RCUTILS_LOG_WARN_ONCE()
RCUTILS_LOG_ERROR_SKIPFIRST_NAMED()
rcutils/logging_macros.h
rcutils/logging.h
Some basic utilities to load, unload and get symbols from shared libraries at run-time.
rcutils/shared_library.h
A string replacement function which takes an allocator, based on http://creativeandcritical.net/str-replace-c:
rcutils/repl_str.h
String splitting functions which take a custom allocator:
rcutils/split.h
A version of
strdup
which takes an allocator:rcutils/strdup.h
Portable implementations of “get system time” and “get steady time”:
rcutils/time.h
Some useful data structures:
A “string array” data structure (analogous to
std::vector<std::string>
):rcutils_string_array_t
rcutils/types/string_array.h
A “string-string map” data structure (analogous to
std::map<std::string, std::string>
)rcutils_string_map_t
rcutils/types/string_map.h
Macros for controlling symbol visibility and linkage for this library:
rcutils/visibility_control.h
Page Hierarchy
Class Hierarchy
-
- Struct rcutils_allocator_s
- Struct rcutils_array_list_s
- Struct rcutils_char_array_s
- Struct rcutils_dir_iter_s
- Struct rcutils_error_state_s
- Struct rcutils_error_string_s
- Struct rcutils_hash_map_s
- Struct rcutils_log_location_s
- Struct rcutils_sha256_ctx_s
- Struct rcutils_shared_library_s
- Struct rcutils_string_array_s
- Struct rcutils_string_map_s
- Struct rcutils_uint8_array_s
- Enum RCUTILS_LOG_SEVERITY
File Hierarchy
-
- Directory include
- Directory rcutils
- Directory testing
- File fault_injection.h
- Directory types
- File array_list.h
- File char_array.h
- File hash_map.h
- File rcutils_ret.h
- File string_array.h
- File string_map.h
- File uint8_array.h
- File allocator.h
- File cmdline_parser.h
- File env.h
- File error_handling.h
- File filesystem.h
- File find.h
- File format_string.h
- File isalnum_no_locale.h
- File logging.h
- File macros.h
- File process.h
- File qsort.h
- File repl_str.h
- File sha256.h
- File shared_library.h
- File snprintf.h
- File split.h
- File stdatomic_helper.h
- File strcasecmp.h
- File strdup.h
- File strerror.h
- File time.h
- File types.h
- File visibility_control.h
- File visibility_control_macros.h
- Directory testing
- Directory rcutils
- File CONTRIBUTING.md
- File QUALITY_DECLARATION.md
- File README.md
- Directory include