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

inet::L2NetworkConfigurator::Matcher::Matcher ( const char *  pattern)
295 {
296  matchesany = isEmpty(pattern);
297 
298  if (matchesany)
299  return;
300 
301  cStringTokenizer tokenizer(pattern);
302 
303  while (tokenizer.hasMoreTokens())
304  matchers.push_back(new inet::PatternMatcher(tokenizer.nextToken(), true, true, true));
305 }
std::vector< inet::PatternMatcher * > matchers
Definition: L2NetworkConfigurator.h:81
bool matchesany
Definition: L2NetworkConfigurator.h:80
Glob-style pattern matching class, adopted to special OMNeT++ requirements.
Definition: PatternMatcher.h:78
bool isEmpty(const char *s)
Definition: L2NetworkConfigurator.cc:35
inet::L2NetworkConfigurator::Matcher::~Matcher ( )
289 {
290  for (auto & elem : matchers)
291  delete elem;
292 }
std::vector< inet::PatternMatcher * > matchers
Definition: L2NetworkConfigurator.h:81

Member Function Documentation

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

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

308 {
309  if (matchesany)
310  return true;
311 
312  for (auto & elem : matchers)
313  if (elem->matches(s))
314  return true;
315 
316 
317  return false;
318 }
std::vector< inet::PatternMatcher * > matchers
Definition: L2NetworkConfigurator.h:81
bool matchesany
Definition: L2NetworkConfigurator.h:80
value< double, units::s > s
Definition: Units.h:1049
bool inet::L2NetworkConfigurator::Matcher::matchesAny ( )
inline

Referenced by inet::L2NetworkConfigurator::readInterfaceConfiguration().

88 { return matchesany; }
bool matchesany
Definition: L2NetworkConfigurator.h:80

Member Data Documentation

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

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