retdec
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
retdec::llvmir2hll::ValidState Class Reference

A mixin providing support for keeping the validity of an object. More...

#include <valid_state.h>

Inheritance diagram for retdec::llvmir2hll::ValidState:
Inheritance graph
[legend]

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
 

Detailed Description

A mixin providing support for keeping the validity of an object.

To use this mixin, inherit from it:

class MyClass: public ValidState {
// ...
}
ValidState()
Constructs a new valid state.
Definition: valid_state.cpp:15

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.

Constructor & Destructor Documentation

◆ ValidState()

retdec::llvmir2hll::ValidState::ValidState ( )
protected

Constructs a new valid state.

Member Function Documentation

◆ invalidateState()

void retdec::llvmir2hll::ValidState::invalidateState ( )

Sets the object's state to invalid.

◆ isInValidState()

bool retdec::llvmir2hll::ValidState::isInValidState ( ) const

Returns true if the object is in a valid state, false otherwise.

◆ validateState()

void retdec::llvmir2hll::ValidState::validateState ( )

Sets the object's state to valid.

Member Data Documentation

◆ validState

bool retdec::llvmir2hll::ValidState::validState
private

The documentation for this class was generated from the following files: