Skip to content

Class nebula::drivers::connections::SockFd

ClassList > nebula > drivers > connections > SockFd

RAII wrapper for a file descriptor, ensuring it is closed when destroyed. Non-copyable, move-only.

  • #include <socket_utils.hpp>

Public Functions

Type Name
SockFd ()
SockFd (int sock_fd)
SockFd (SockFd && other) noexcept
SockFd (const SockFd &) = delete
int get () const
SockFd & operator= (const SockFd &) = delete
SockFd & operator= (SockFd && other) noexcept
util::expected< std::monostate, SocketError > setsockopt (int level, int optname, const T & optval)
Wrapper for setsockopt.
~SockFd ()

Public Functions Documentation

function SockFd [1/4]

inline nebula::drivers::connections::SockFd::SockFd () 

function SockFd [2/4]

inline explicit nebula::drivers::connections::SockFd::SockFd (
    int sock_fd
) 

function SockFd [3/4]

inline nebula::drivers::connections::SockFd::SockFd (
    SockFd && other
) noexcept

function SockFd [4/4]

nebula::drivers::connections::SockFd::SockFd (
    const SockFd &
) = delete

function get

inline int nebula::drivers::connections::SockFd::get () const

function operator=

SockFd & nebula::drivers::connections::SockFd::operator= (
    const SockFd &
) = delete

function operator=

inline SockFd & nebula::drivers::connections::SockFd::operator= (
    SockFd && other
) noexcept

function setsockopt

Wrapper for setsockopt.

template<typename T>
inline util::expected < std::monostate, SocketError > nebula::drivers::connections::SockFd::setsockopt (
    int level,
    int optname,
    const T & optval
) 

Template parameters:

  • T Type of the option value.

Parameters:

  • level Protocol level.
  • optname Option name.
  • optval The option value.

Returns:

Success (std::monostate) or SocketError.


function ~SockFd

inline nebula::drivers::connections::SockFd::~SockFd () 


The documentation for this class was generated from the following file src/nebula_core/nebula_core_hw_interfaces/include/nebula_core_hw_interfaces/nebula_hw_interfaces_common/connections/socket_utils.hpp