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::CharClass Class Reference
Collaboration diagram for duckdb_re2::CharClass:

Public Types

typedef RuneRange * iterator

Public Member Functions

void Delete ()
iterator begin ()
iterator end ()
int size ()
bool empty ()
bool full ()
bool FoldsASCII ()
bool Contains (Rune r) const
CharClass * Negate ()

Private Member Functions

 CharClass (const CharClass &)=delete
CharClass & operator= (const CharClass &)=delete

Static Private Member Functions

static CharClass * New (size_t maxranges)

Private Attributes

bool folds_ascii_
int nrunes_
RuneRange * ranges_
int nranges_

Friends

class CharClassBuilder

Member Function Documentation

◆ Delete()

void duckdb_re2::CharClass::Delete ( )
473885 {
473886 uint8_t* data = reinterpret_cast<uint8_t*>(this);
473887 delete[] data;
473888}
::uint8_t uint8_t

◆ begin()

iterator duckdb_re2::CharClass::begin ( )
inline
322455{ return ranges_; }

◆ end()

iterator duckdb_re2::CharClass::end ( )
inline
322456{ return ranges_ + nranges_; }

◆ size()

int duckdb_re2::CharClass::size ( )
inline
322458{ return nrunes_; }

◆ empty()

bool duckdb_re2::CharClass::empty ( )
inline
322459{ return nrunes_ == 0; }

◆ full()

bool duckdb_re2::CharClass::full ( )
inline
322460{ return nrunes_ == Runemax+1; }

◆ FoldsASCII()

bool duckdb_re2::CharClass::FoldsASCII ( )
inline
322461{ return folds_ascii_; }

◆ Contains()

bool duckdb_re2::CharClass::Contains ( Rune r) const
473910 {
473911 RuneRange* rr = ranges_;
473912 int n = nranges_;
473913 while (n > 0) {
473914 int m = n/2;
473915 if (rr[m].hi < r) {
473916 rr += m+1;
473917 n -= m+1;
473918 } else if (r < rr[m].lo) {
473919 n = m;
473920 } else { // rr[m].lo <= r && r <= rr[m].hi
473921 return true;
473922 }
473923 }
473924 return false;
473925}

◆ Negate()

CharClass * duckdb_re2::CharClass::Negate ( )
473890 {
473891 CharClass* cc = CharClass::New(static_cast<size_t>(nranges_+1));
473892 cc->folds_ascii_ = folds_ascii_;
473893 cc->nrunes_ = Runemax + 1 - nrunes_;
473894 int n = 0;
473895 int nextlo = 0;
473896 for (CharClass::iterator it = begin(); it != end(); ++it) {
473897 if (it->lo == nextlo) {
473898 nextlo = it->hi + 1;
473899 } else {
473900 cc->ranges_[n++] = RuneRange(nextlo, it->lo - 1);
473901 nextlo = it->hi + 1;
473902 }
473903 }
473904 if (nextlo <= Runemax)
473905 cc->ranges_[n++] = RuneRange(nextlo, Runemax);
473906 cc->nranges_ = n;
473907 return cc;
473908}

◆ New()

CharClass * duckdb_re2::CharClass::New ( size_t maxranges)
staticprivate
473874 {
473875 CharClass* cc;
473876 uint8_t* data = new uint8_t[sizeof *cc + maxranges*sizeof cc->ranges_[0]];
473877 cc = reinterpret_cast<CharClass*>(data);
473878 cc->ranges_ = reinterpret_cast<RuneRange*>(data + sizeof *cc);
473879 cc->nranges_ = 0;
473880 cc->folds_ascii_ = false;
473881 cc->nrunes_ = 0;
473882 return cc;
473883}

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