15 #ifndef RCLCPP__UTILITIES_HPP_ 16 #define RCLCPP__UTILITIES_HPP_ 56 init(
int argc,
char const *
const argv[],
const InitOptions & init_options = InitOptions());
110 char const *
const argv[],
111 const InitOptions & init_options = InitOptions());
144 ok(rclcpp::Context::SharedPtr context =
nullptr);
176 rclcpp::Context::SharedPtr context =
nullptr,
177 const std::string & reason =
"user called rclcpp::shutdown()");
215 rclcpp::Context::SharedPtr context =
nullptr);
248 return (y < 0) && (x < (std::numeric_limits<T>::min() - y));
282 return (y > 0) && (x < (std::numeric_limits<T>::min() + y));
307 #endif // RCLCPP__UTILITIES_HPP_ bool signal_handlers_installed()
Return true if the signal handlers are installed, otherwise false.
bool sub_will_overflow(const T x, const T y)
Safely check if subtraction will overflow.
Definition: utilities.hpp:263
This header provides the get_node_topics_interface() template function.
Definition: allocator_common.hpp:24
bool add_will_underflow(const T x, const T y)
Safely check if addition will underflow.
Definition: utilities.hpp:246
bool shutdown(rclcpp::Context::SharedPtr context=nullptr, const std::string &reason="user called rclcpp::shutdown()")
Shutdown rclcpp context, invalidating it for derived entities.
const char * get_c_string(const std::string &string_in)
Return the C string from the given std::string.
void init(int argc, char const *const argv[], const InitOptions &init_options=InitOptions())
Initialize communications via the rmw implementation and set up a global signal handler.
bool sleep_for(const std::chrono::nanoseconds &nanoseconds, rclcpp::Context::SharedPtr context=nullptr)
Use the global condition variable to block for the specified amount of time.
bool sub_will_underflow(const T x, const T y)
Safely check if subtraction will underflow.
Definition: utilities.hpp:280
bool is_initialized(rclcpp::Context::SharedPtr context=nullptr)
Return true if init() has already been called for the given context.
void on_shutdown(std::function< void()> callback, rclcpp::Context::SharedPtr context=nullptr)
Register a function to be called when shutdown is called on the context.
bool add_will_overflow(const T x, const T y)
Safely check if addition will overflow.
Definition: utilities.hpp:229
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
bool ok(rclcpp::Context::SharedPtr context=nullptr)
Check rclcpp's status.
std::vector< std::string > init_and_remove_ros_arguments(int argc, char const *const argv[], const InitOptions &init_options=InitOptions())
Initialize communications via the rmw implementation and set up a global signal handler.
bool uninstall_signal_handlers()
Uninstall the global signal handler for rclcpp.
std::vector< std::string > remove_ros_arguments(int argc, char const *const argv[])
Remove ROS-specific arguments from argument vector.
bool install_signal_handlers()
Install the global signal handler for rclcpp.