gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::ObjectMatch Class Reference

ObjectMatch contains a vector of expressions. More...

#include <match.hh>

Public Member Functions

 ObjectMatch ()
 
 ObjectMatch (const std::string &expression)
 
void add (const ObjectMatch &other)
 
void setExpression (const std::string &expression)
 
void setExpression (const std::vector< std::string > &expression)
 
std::vector< std::vector< std::string > > getExpressions ()
 
bool empty () const
 
bool match (const std::string &name) const
 

Protected Member Functions

bool domatch (const std::string &name) const
 

Protected Attributes

std::vector< std::vector< std::string > > tokens
 

Detailed Description

ObjectMatch contains a vector of expressions.

ObjectMatch can then be queried, via ObjectMatch.match(std::string), to check if a string matches any expressions in the vector.

Expressions in ObjectMatch take the form "<token1>.<token2>.<token3>"; a series of expected tokens separated by a period. The input string takes the form "<value1>.<value2>.<value3>". In this case, the input string matches the expression if <value1> == <token1> && <token2> == <value2> && <value3> == <token3>. A token may be a wildcard character, "*", which will match to any value in that position (inclusive of no value at that location).

Definition at line 56 of file match.hh.

Constructor & Destructor Documentation

◆ ObjectMatch() [1/2]

gem5::ObjectMatch::ObjectMatch ( )

Definition at line 37 of file match.cc.

◆ ObjectMatch() [2/2]

gem5::ObjectMatch::ObjectMatch ( const std::string & expression)

Definition at line 41 of file match.cc.

References setExpression().

Member Function Documentation

◆ add()

void gem5::ObjectMatch::add ( const ObjectMatch & other)

Definition at line 47 of file match.cc.

References tokens.

Referenced by gem5::trace::Logger::addActivate(), gem5::trace::Logger::addIgnore(), and TEST().

◆ domatch()

bool gem5::ObjectMatch::domatch ( const std::string & name) const
protected
Todo
this should probably be changed to just use regular expression code

Definition at line 76 of file match.cc.

References gem5::ArmISA::i, match(), name(), gem5::scmi::token, gem5::tokenize(), and tokens.

Referenced by match().

◆ empty()

bool gem5::ObjectMatch::empty ( ) const
inline

Definition at line 69 of file match.hh.

References tokens.

Referenced by gem5::trace::Logger::isEnabled().

◆ getExpressions()

std::vector< std::vector< std::string > > gem5::ObjectMatch::getExpressions ( )

Definition at line 107 of file match.cc.

References tokens.

Referenced by TEST(), TEST(), and TEST().

◆ match()

bool gem5::ObjectMatch::match ( const std::string & name) const
inline

Definition at line 73 of file match.hh.

References domatch(), name(), and tokens.

Referenced by domatch(), gem5::trace::Logger::isEnabled(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ setExpression() [1/2]

void gem5::ObjectMatch::setExpression ( const std::string & expression)

Definition at line 53 of file match.cc.

References gem5::tokenize(), and tokens.

Referenced by ObjectMatch(), TEST(), TEST(), TEST(), and TEST().

◆ setExpression() [2/2]

void gem5::ObjectMatch::setExpression ( const std::vector< std::string > & expression)

Definition at line 60 of file match.cc.

References gem5::ArmISA::i, gem5::tokenize(), and tokens.

Member Data Documentation

◆ tokens

std::vector<std::vector<std::string> > gem5::ObjectMatch::tokens
protected

Definition at line 59 of file match.hh.

Referenced by add(), domatch(), empty(), getExpressions(), match(), setExpression(), and setExpression().


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

Generated on Tue Jun 18 2024 16:24:13 for gem5 by doxygen 1.11.0