Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb_re2::DFA::StateSaver Class Reference
Collaboration diagram for duckdb_re2::DFA::StateSaver:

Public Member Functions

 StateSaver (DFA *dfa, State *state)
State * Restore ()

Private Member Functions

 StateSaver (const StateSaver &)=delete
StateSaver & operator= (const StateSaver &)=delete

Private Attributes

DFA * dfa_
int * inst_
int ninst_
uint32_t flag_
bool is_special_
State * special_

Constructor & Destructor Documentation

◆ StateSaver()

duckdb_re2::DFA::StateSaver::StateSaver ( DFA * dfa,
State * state )
explicit
463587 {
463588 dfa_ = dfa;
463589 if (state <= SpecialStateMax) {
463590 inst_ = NULL;
463591 ninst_ = 0;
463592 flag_ = 0;
463593 is_special_ = true;
463594 special_ = state;
463595 return;
463596 }
463597 is_special_ = false;
463598 special_ = NULL;
463599 flag_ = state->flag_;
463600 ninst_ = state->ninst_;
463601 inst_ = new int[ninst_];
463602 memmove(inst_, state->inst_, ninst_*sizeof inst_[0]);
463603}

◆ ~StateSaver()

duckdb_re2::DFA::StateSaver::~StateSaver ( )
463605 {
463606 if (!is_special_)
463607 delete[] inst_;
463608}

Member Function Documentation

◆ Restore()

DFA::State * duckdb_re2::DFA::StateSaver::Restore ( )
463610 {
463611 if (is_special_)
463612 return special_;
463613 MutexLock l(&dfa_->mutex_);
463614 State* s = dfa_->CachedState(inst_, ninst_, flag_);
463615 if (s == NULL)
463616 LOG(DFATAL) << "StateSaver failed to restore state.";
463617 return s;
463618}

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