oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Enumerations | Functions
error.hpp File Reference

Strong ove::Error type, Result<T> alias, and std::error_code interop for the oveRTOS C++ binding. More...

#include <ove/ove.h>
#include <expected>
#include <string>
#include <system_error>
#include <type_traits>
#include <utility>
Include dependency graph for error.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ove::detail::error_category_impl
 std::error_category implementation for Error values. More...
 
struct  std::is_error_code_enum< ove::Error >
 

Namespaces

namespace  ove
 Top-level namespace for all oveRTOS C++ abstractions.
 

Typedefs

template<class T = void>
using ove::Result = std::expected< T, Error >
 std::expected-based result alias.
 

Enumerations

enum class  ove::Error : int {
  Ok = OVE_OK , NotRegistered = OVE_ERR_NOT_REGISTERED , InvalidParam = OVE_ERR_INVALID_PARAM , NoMemory = OVE_ERR_NO_MEMORY ,
  Timeout = OVE_ERR_TIMEOUT , NotSupported = OVE_ERR_NOT_SUPPORTED , QueueFull = OVE_ERR_QUEUE_FULL , MlFailed = OVE_ERR_ML_FAILED ,
  NetRefused = OVE_ERR_NET_REFUSED , NetUnreachable = OVE_ERR_NET_UNREACHABLE , NetAddrInUse = OVE_ERR_NET_ADDR_IN_USE , NetReset = OVE_ERR_NET_RESET ,
  NetDnsFail = OVE_ERR_NET_DNS_FAIL , NetClosed = OVE_ERR_NET_CLOSED , BusNack = OVE_ERR_BUS_NACK , BusBusy = OVE_ERR_BUS_BUSY ,
  BusError = OVE_ERR_BUS_ERROR , QueueEmpty = OVE_ERR_QUEUE_EMPTY , WouldBlock = OVE_ERR_WOULD_BLOCK , Eof = OVE_ERR_EOF ,
  Inval = OVE_ERR_INVAL , NotFound = OVE_ERR_NOT_FOUND
}
 Strong-typed mirror of substrate OVE_ERR_* codes. More...
 

Functions

const std::error_category & ove::error_category () noexcept
 Returns the singleton std::error_category for Error.
 
std::error_code ove::make_error_code (Error e) noexcept
 ADL-discoverable factory for std::error_code from Error.
 
Result< void > ove::from_rc (int rc) noexcept
 Lifts a substrate rc-code into a Result<void>.
 
template<class T >
Result< std::decay_t< T > > ove::from_rc (int rc, T &&value)
 Lifts a substrate rc + success-side value into a Result<T>.
 

Detailed Description

Strong ove::Error type, Result<T> alias, and std::error_code interop for the oveRTOS C++ binding.

Provides the foundation for Result<T>-shaped fallible operations. Primitives migrate to returning Result<T> in their own iterations; for any not-yet-migrated primitive the substrate's int rc is still the canonical surface, and from_rc lifts those rc-codes into a Result at the call site.

Drift guard. Each Error variant is static_assert-pinned to its OVE_* substrate constant — and <ove/types.h> independently pins every OVE_ERR_* to a literal integer. A renumbering in either layer breaks the build before producing a binary.