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

inet::InterfaceMatcher::Matcher::Matcher ( const char *  pattern)
34 {
35  matchesany = isEmpty(pattern);
36  if (matchesany)
37  return;
38  cStringTokenizer tokenizer(pattern);
39  while (tokenizer.hasMoreTokens())
40  matchers.push_back(new inet::PatternMatcher(tokenizer.nextToken(), true, true, true));
41 }
bool matchesany
Definition: InterfaceMatcher.h:54
std::vector< inet::PatternMatcher * > matchers
Definition: InterfaceMatcher.h:55
Glob-style pattern matching class, adopted to special OMNeT++ requirements.
Definition: PatternMatcher.h:78
bool isEmpty(const char *s)
Definition: L2NetworkConfigurator.cc:35
inet::InterfaceMatcher::Matcher::~Matcher ( )
44 {
45  for (auto & elem : matchers)
46  delete elem;
47 }
std::vector< inet::PatternMatcher * > matchers
Definition: InterfaceMatcher.h:55

Member Function Documentation

bool inet::InterfaceMatcher::Matcher::matches ( const char *  s) const

Referenced by inet::InterfaceMatcher::linkContainsMatchingHost(), and inet::InterfaceMatcher::Selector::matches().

50 {
51  if (matchesany)
52  return true;
53  for (auto & elem : matchers)
54  if (elem->matches(s))
55  return true;
56 
57  return false;
58 }
bool matchesany
Definition: InterfaceMatcher.h:54
std::vector< inet::PatternMatcher * > matchers
Definition: InterfaceMatcher.h:55
value< double, units::s > s
Definition: Units.h:1049
bool inet::InterfaceMatcher::Matcher::matchesAny ( ) const
inline

Referenced by inet::InterfaceMatcher::Selector::matches().

61 { return matchesany; }
bool matchesany
Definition: InterfaceMatcher.h:54

Member Data Documentation

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

Referenced by Matcher(), matches(), and ~Matcher().

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

Referenced by Matcher(), and matches().


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