AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
This class implements a simple scope guard class.
It will allow an item to be set to a particular value from construction and then reset when destroyed.
This class is similar to many C++ scope guard cases (e.g. std::unique_ptr) but intended for simple cases where say a value of a class is to be set from the construction point onwards and then reset when the destructor is run.
#include "util.hh"
Public Member Functions | |
ScopeGuard (T &item, const T executionVal) | |
Construct a ScopeGuard for the specified item. | |
ScopeGuard (T &item, const T executionVal, const T exitVal) | |
Construct a ScopeGuard for the specified item. | |
~ScopeGuard () | |
Destroy the ScopeGuard item, restoring its value to the specified exit value. | |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tony.farrell@mq.edu.au
Generated on Thu Dec 12 2024 23:07:35 for AAO DRAMA/DRAMA2 C++ Interface by 1.9.8