Argus Camera Sample
Argus Camera Sample
|
RAII-syle class performing an action when control flow leaves the scope. More...
#include <ScopedGuard.h>
Public Types | |
typedef bool(T::* | ActionType )() |
Action function type. |
Public Member Functions | |
ScopedGuard (T *object, ActionType action) | |
Constructor. | |
~ScopedGuard () | |
Destructor. | |
void | cancel () |
Cancel the action associated with this instance. |
Private Member Functions | |
void | leaveScope () |
Called when leaving the scope. | |
ScopedGuard () | |
Hide default/copy constructor and assignment operator. | |
ScopedGuard (ScopedGuard &other) | |
const ScopedGuard & | operator= (const ScopedGuard &) |
Private Attributes | |
T * | m_object |
ActionType | m_action |
RAII-syle class performing an action when control flow leaves the scope.
Typically the action to be performed is to undo a previous action in case of an error.
Definition at line 39 of file ScopedGuard.h.
typedef bool(T::* ArgusSamples::ScopedGuard< T >::ActionType)() |
Action function type.
Definition at line 45 of file ScopedGuard.h.
|
inline |
Constructor.
object | [in] the object to perform the action on |
action | [in] the action to perform |
Definition at line 53 of file ScopedGuard.h.
|
inline |
Destructor.
Definition at line 61 of file ScopedGuard.h.
|
private |
Hide default/copy constructor and assignment operator.
|
private |
|
inline |
Cancel the action associated with this instance.
Definition at line 69 of file ScopedGuard.h.
|
inlineprivate |
Called when leaving the scope.
Calls action and resets the action.
Definition at line 81 of file ScopedGuard.h.
|
private |
|
private |
Definition at line 76 of file ScopedGuard.h.
|
private |
Definition at line 75 of file ScopedGuard.h.