AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
|
This class implements a simple scope guard class with an std::atomic based type as the underlying type.
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. Unlike the ScopeGuard class, by using a std::atomic<> based item as the item we guard, the guarded value is thread safe.
#include "util.hh"
Public Member Functions | |
ScopeGuardAtomic (AT &item, const T executionVal) | |
Construct a ScopeGuardAtomic for the specified item. | |
ScopeGuardAtomic (AT &item, const T executionVal, const T exitVal) | |
Construct a ScopeGuardAtomic for the specified item. | |
~ScopeGuardAtomic () | |
Destroy the ScopeGuardAtomic 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