USRP Hardware Driver and USRP Manual  Version:
UHD and USRP Manual
uhd::utils::scope_exit Class Reference

#include <uhd/utils/scope_exit.hpp>

Public Types

using uptr = std::unique_ptr< scope_exit >
using exit_cb_t = std::function< void(void)>

Public Member Functions

 ~scope_exit ()

Static Public Member Functions

static uptr make (exit_cb_t &&exit_cb)

Detailed Description

A class that will execute a function on its destruction

Similar to Boost.ScopeExit. A useful tool for RAII-style operations.

Note: The creation of the object can be costly if converting the exit callback to exit_cb_t incurs copying overhead. Keep this in mind when using this object in a high-performance path.

Member Typedef Documentation

◆ exit_cb_t

using uhd::utils::scope_exit::exit_cb_t = std::function<void(void)>

◆ uptr

using uhd::utils::scope_exit::uptr = std::unique_ptr<scope_exit>

Constructor & Destructor Documentation

◆ ~scope_exit()

uhd::utils::scope_exit::~scope_exit ( )

Member Function Documentation

◆ make()

static uptr uhd::utils::scope_exit::make ( exit_cb_t &&  exit_cb)

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