INET Framework for OMNeT++/OMNEST
inet::InterfaceMatcher::Matcher Class Reference

Public Member Functions

 Matcher (const char *pattern)
 
 ~Matcher ()
 
bool matches (const char *s) const
 
bool matchesAny () const
 

Private Attributes

bool matchesany
 
std::vector< inet::PatternMatcher * > matchers
 

Constructor & Destructor Documentation

◆ Matcher()

inet::InterfaceMatcher::Matcher::Matcher ( const char *  pattern)
22 {
23  matchesany = opp_isempty(pattern);
24  if (matchesany)
25  return;
26  cStringTokenizer tokenizer(pattern);
27  while (tokenizer.hasMoreTokens())
28  matchers.push_back(new inet::PatternMatcher(tokenizer.nextToken(), true, true, true));
29 }

◆ ~Matcher()

inet::InterfaceMatcher::Matcher::~Matcher ( )
32 {
33  for (auto& elem : matchers)
34  delete elem;
35 }

Member Function Documentation

◆ matches()

bool inet::InterfaceMatcher::Matcher::matches ( const char *  s) const
38 {
39  if (matchesany)
40  return true;
41  for (auto& elem : matchers)
42  if (elem->matches(s))
43  return true;
44 
45  return false;
46 }

Referenced by inet::InterfaceMatcher::linkContainsMatchingHost().

◆ matchesAny()

bool inet::InterfaceMatcher::Matcher::matchesAny ( ) const
inline
48 { return matchesany; }

Member Data Documentation

◆ matchers

std::vector<inet::PatternMatcher *> inet::InterfaceMatcher::Matcher::matchers
private

Referenced by Matcher().

◆ matchesany

bool inet::InterfaceMatcher::Matcher::matchesany
private

Referenced by Matcher().


The documentation for this class was generated from the following files:
inet::InterfaceMatcher::Matcher::matchers
std::vector< inet::PatternMatcher * > matchers
Definition: InterfaceMatcher.h:42
inet::units::values::s
value< double, units::s > s
Definition: Units.h:1235
inet::PatternMatcher
Glob-style pattern matching class, adopted to special OMNeT++ requirements.
Definition: PatternMatcher.h:69
inet::InterfaceMatcher::Matcher::matchesany
bool matchesany
Definition: InterfaceMatcher.h:41