|
PLCnext API Documentation 25.0.2.69
|
This class is a utility class which provides a generic guard to implement the RAII idiom. More...
#include <RaiiGuard.hpp>
Public Types | |
| using | Operation = delegate< void(void)> |
Public Member Functions | |
| RaiiGuard (Operation destructing) | |
| Constructs an RaiiGuard instance. More... | |
| RaiiGuard (Operation constructing, Operation destructing) | |
| Constructs an RaiiGuard instance. More... | |
| RaiiGuard (const RaiiGuard &arg)=delete | |
| RaiiGuard (RaiiGuard &&arg) noexcept=delete | |
| RaiiGuard & | operator= (const RaiiGuard &arg)=delete |
| RaiiGuard & | operator= (RaiiGuard &&arg) noexcept=delete |
| ~RaiiGuard (void) | |
| Invokes the destructing operation, which was passed to the constructor. | |
This class is a utility class which provides a generic guard to implement the RAII idiom.
The operations to invoke at construction or destruction of the guard, are passed as delegate or lambda to the constructor.
|
explicit |
Constructs an RaiiGuard instance.
| destructing | The lambda operation invoked during destruction to free any resources. |
Constructs an RaiiGuard instance.
| constructing | The lambda operation invoked during construction to allocate any resources. |
| destructing | The lambda operation invoked during destruction to free any resources. |