nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rclcpp::ResultOf< void > Class Reference

#include <result.hpp>

Public Member Functions

ErrorCode code () const
 Get the underlying error code.
 
bool ok () const
 Returns true if the operation succeeded.
 
 operator bool () const
 Explicit bool conversion — allows if (result) { ... }.
 
int32_t raw () const
 Get the raw integer code (for FFI interop).
 
constexpr ResultOf ()
 Default-construct a success.
 
constexpr ResultOf (ErrorCode code)
 Construct from a typed code.
 
constexpr ResultOf (int32_t raw)
 Construct from a raw FFI return value (int32_t).
 

Static Public Member Functions

static constexpr ResultOf success ()
 Named constructors.
 

Detailed Description

Result — a fallible operation that produces no value.

NROS_NODISCARD: a discarded result is a failure nobody was told about, which is the one outcome this channel exists to prevent. That attribute is a signal to a reader and to a -Werror consumer, not an enforced gate in this tree (see NROS_NODISCARD's own doc above for the measured warning-vs-error spelling); where a failure must not be ignorable, the refusal has to be at RUNTIME — which is what rclcpp::detail::require_created does for the create_* verbs, and what rclcpp::init(argc, argv) already does for --ros-args.

Constructor & Destructor Documentation

◆ ResultOf() [1/3]

constexpr rclcpp::ResultOf< void >::ResultOf ( )
inlineconstexpr

Default-construct a success.

◆ ResultOf() [2/3]

constexpr rclcpp::ResultOf< void >::ResultOf ( ErrorCode  code)
inlineconstexpr

Construct from a typed code.

◆ ResultOf() [3/3]

constexpr rclcpp::ResultOf< void >::ResultOf ( int32_t  raw)
inlineconstexpr

Construct from a raw FFI return value (int32_t).

Member Function Documentation

◆ code()

ErrorCode rclcpp::ResultOf< void >::code ( ) const
inline

Get the underlying error code.

◆ ok()

bool rclcpp::ResultOf< void >::ok ( ) const
inline

Returns true if the operation succeeded.

◆ operator bool()

rclcpp::ResultOf< void >::operator bool ( ) const
inlineexplicit

Explicit bool conversion — allows if (result) { ... }.

◆ raw()

int32_t rclcpp::ResultOf< void >::raw ( ) const
inline

Get the raw integer code (for FFI interop).

◆ success()

static constexpr ResultOf rclcpp::ResultOf< void >::success ( )
inlinestaticconstexpr

Named constructors.


The documentation for this class was generated from the following file: