Unit Test Framework Modern C++ API Reference
rti::test::RaiiWrapper< T, R1, InitializeFn, R2, FinalizeFn > Struct Template Reference

Auxiliary class that augments C structs with a destructor. More...

#include <Tester.hpp>

Inherits T.

Detailed Description

template<typename T, typename R1, R1 InitializeFn, typename R2, R2 FinalizeFn>
struct rti::test::RaiiWrapper< T, R1, InitializeFn, R2, FinalizeFn >

Auxiliary class that augments C structs with a destructor.

Parameters
TThe type of the struct to augment.
R1The return type of the initializer function.
InitializeFnThe function to call when the struct is created.
R2The return type of the finalizer function.
FinalizeFnThe function to call when the struct is destroyed.

This class is used to wrap C structs that have a constructor and destructor function. The constructor will call the provided initializer function, and the destructor will call the provided finalizer function. The struct must be trivially destructible.