17 #ifndef IOX_UTILS_CXX_GENERIC_RAII_HPP
18 #define IOX_UTILS_CXX_GENERIC_RAII_HPP
20 #include "iceoryx_utils/cxx/function_ref.hpp"
50 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 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(const std::function< void()> cleanupFunction) noexcept
constructor which creates GenericRAII that calls only the cleanupFunction on destruction
~GenericRAII() noexcept
calls m_cleanupFunction callable if it was set in the constructor
Definition: function_ref.hpp:32
building block to easily create free function for logging in a library context
Definition: lockfree_queue.hpp:28