retdec
|
A mixin providing support for keeping the validity of an object. More...
#include <valid_state.h>
Public Member Functions | |
bool | isInValidState () const |
Returns true if the object is in a valid state, false otherwise. More... | |
void | invalidateState () |
Sets the object's state to invalid. More... | |
void | validateState () |
Sets the object's state to valid. More... | |
Protected Member Functions | |
ValidState () | |
Constructs a new valid state. More... | |
Private Attributes | |
bool | validState |
A mixin providing support for keeping the validity of an object.
To use this mixin, inherit from it:
Then, instances of MyClass
will have a set of methods for obtaining and setting the object validity. After creation, every instance is in a valid state. When an instance becomes invalid (for example, you modify it somehow), call invalidateState() so further calls to isInValidState() return false
. The precise conditions when an instance should get into an invalid state depends on what your class does. When an instance becomes valid, call validateState() so further calls to isInValidState() return true
.
|
protected |
Constructs a new valid state.
void retdec::llvmir2hll::ValidState::invalidateState | ( | ) |
Sets the object's state to invalid.
bool retdec::llvmir2hll::ValidState::isInValidState | ( | ) | const |
Returns true
if the object is in a valid state, false
otherwise.
void retdec::llvmir2hll::ValidState::validateState | ( | ) |
Sets the object's state to valid.
|
private |