ROSE
0.11.28.0
|
RAII guard for solver stack.
This object implements a rudimentary form of SMT transactions. The constructor starts a new transaction by pushing a new level onto the specified solver (if the solver is non-null). The destructor pops transactions until it gets back to the same number of levels as originally. It is undefined behavior if the solver has fewer transactions than originally when the destructor is called. If commit has been called on this object then the destructor does nothing.
This guard object makes no attempt to ensure that after popping levels we end up at the same level we started at. In other words, although the number of levels is back to where we started, it might have been possible that between the constructor and destructor we popped past this transaction and then pushed new transactions to replace it with a different transaction.
Definition at line 123 of file BinarySmtSolver.h.
#include <BinarySmtSolver.h>
Public Member Functions | |
Transaction (const SmtSolver::Ptr &solver) | |
Constructor pushes level if solver is non-null. More... | |
~Transaction () | |
Destructor pops level unless canceled. More... | |
void | commit (bool b=true) |
Cancel the popping during the destructor. More... | |
bool | isCommitted () const |
Whether the guard is canceled. More... | |
SmtSolver::Ptr | solver () const |
Solver being protected. More... | |
|
inlineexplicit |
Constructor pushes level if solver is non-null.
It is safe to call this with a null solver.
Definition at line 131 of file BinarySmtSolver.h.
|
inline |
Destructor pops level unless canceled.
Definition at line 142 of file BinarySmtSolver.h.
|
inline |
Cancel the popping during the destructor.
Definition at line 156 of file BinarySmtSolver.h.
|
inline |
Whether the guard is canceled.
Definition at line 161 of file BinarySmtSolver.h.
|
inline |
Solver being protected.
Definition at line 166 of file BinarySmtSolver.h.