17#ifndef IOX_HOOFS_CXX_GENERIC_RAII_HPP
18#define IOX_HOOFS_CXX_GENERIC_RAII_HPP
20#include "iceoryx_hoofs/cxx/function_ref.hpp"
50 explicit GenericRAII(
const std::function<
void()>& cleanupFunction)
noexcept;
71 void destroy() noexcept;
74 std::function<
void()> m_cleanupFunction;
The GenericRAII class is a simple helper class to apply the C++ RAII idiom quickly....
Definition generic_raii.hpp:46
GenericRAII(const std::function< void()> &cleanupFunction) noexcept
constructor which creates GenericRAII that calls only the cleanupFunction on destruction
GenericRAII(const function_ref< void()> &initFunction, const std::function< void()> &cleanupFunction) noexcept
constructor which calls initFunction and stores the cleanupFunction which will be called in the destr...
~GenericRAII() noexcept
calls m_cleanupFunction callable if it was set in the constructor
Definition function_ref.hpp:34
building block to easily create free function for logging in a library context
Definition lockfree_queue.hpp:29