Quick Links: |
#include <bdlcc_deque.h>
Public Member Functions | |
VectorThrowGuard (VECTOR *vector_p) | |
~VectorThrowGuard () | |
void | release () |
This private class
is used to manage one vector
object during the course of an operation by a bdlcc::Deque
. Because it has a release
method, it is actually a proctor, but we call it a guard
to avoid having clients confuse it with the Proctor
and ConstProctor
types. The vector may only grow by having objects appended to it. If a throw happens during the course of the operation and the guard's destructor is called while still managing the object, it will restore the managed object to its initial state via operations that are guaranteed not to throw.
bdlcc::Deque< TYPE >::VectorThrowGuard< VECTOR >::VectorThrowGuard | ( | VECTOR * | vector_p | ) | [explicit] |
Create a VectorThrowGuard
object that will manage the specified *vector_p
. Note that the case where 0 == vector_p
is explicitly permitted, in which case this object will not manage anything.
bdlcc::Deque< TYPE >::VectorThrowGuard< VECTOR >::~VectorThrowGuard | ( | ) |
If a vector
is being managed by this VectorThrowGuard
, restore it to the state it was in when this object was created.
void bdlcc::Deque< TYPE >::VectorThrowGuard< VECTOR >::release | ( | ) |
Release the monitored vector
from management by this VectorThrowGuard
object.