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

#include <L2NetworkConfigurator.h>

Public Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

◆ Matcher()

inet::L2NetworkConfigurator::Matcher::Matcher ( const char *  pattern)
273 {
274  matchesany = opp_isempty(pattern);
275 
276  if (matchesany)
277  return;
278 
279  cStringTokenizer tokenizer(pattern);
280 
281  while (tokenizer.hasMoreTokens())
282  matchers.push_back(new inet::PatternMatcher(tokenizer.nextToken(), true, true, true));
283 }

◆ ~Matcher()

inet::L2NetworkConfigurator::Matcher::~Matcher ( )
267 {
268  for (auto& elem : matchers)
269  delete elem;
270 }

Member Function Documentation

◆ matches()

bool inet::L2NetworkConfigurator::Matcher::matches ( const char *  s)
286 {
287  if (matchesany)
288  return true;
289 
290  for (auto& elem : matchers)
291  if (elem->matches(s))
292  return true;
293 
294  return false;
295 }

Referenced by inet::L2NetworkConfigurator::linkContainsMatchingHostExcept(), and inet::L2NetworkConfigurator::readInterfaceConfiguration().

◆ matchesAny()

bool inet::L2NetworkConfigurator::Matcher::matchesAny ( )
inline

Member Data Documentation

◆ matchers

std::vector<inet::PatternMatcher *> inet::L2NetworkConfigurator::Matcher::matchers
protected

◆ matchesany

bool inet::L2NetworkConfigurator::Matcher::matchesany
protected

The documentation for this class was generated from the following files:
inet::L2NetworkConfigurator::Matcher::matchesany
bool matchesany
Definition: L2NetworkConfigurator.h:64
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::L2NetworkConfigurator::Matcher::matchers
std::vector< inet::PatternMatcher * > matchers
Definition: L2NetworkConfigurator.h:65