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

#include <NetworkConfiguratorBase.h>

Public Member Functions

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

Protected Attributes

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

Constructor & Destructor Documentation

inet::NetworkConfiguratorBase::Matcher::Matcher ( const char *  pattern)
524 {
525  matchesany = isEmpty(pattern);
526  if (matchesany)
527  return;
528  cStringTokenizer tokenizer(pattern);
529  while (tokenizer.hasMoreTokens())
530  matchers.push_back(new inet::PatternMatcher(tokenizer.nextToken(), true, true, true));
531 }
bool matchesany
Definition: NetworkConfiguratorBase.h:131
std::vector< inet::PatternMatcher * > matchers
Definition: NetworkConfiguratorBase.h:132
Glob-style pattern matching class, adopted to special OMNeT++ requirements.
Definition: PatternMatcher.h:78
bool isEmpty(const char *s)
Definition: L2NetworkConfigurator.cc:35
inet::NetworkConfiguratorBase::Matcher::~Matcher ( )
534 {
535  for (auto & matcher : matchers)
536  delete matcher;
537 }
std::vector< inet::PatternMatcher * > matchers
Definition: NetworkConfiguratorBase.h:132

Member Function Documentation

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

Referenced by inet::IPv4NetworkConfigurator::addStaticRoutes(), inet::NetworkConfiguratorBase::getWirelessId(), inet::IPv4NetworkConfigurator::linkContainsMatchingHostExcept(), inet::IPv4NetworkConfigurator::readInterfaceConfiguration(), inet::IPv4NetworkConfigurator::readManualMulticastRouteConfiguration(), inet::IPv4NetworkConfigurator::readManualRouteConfiguration(), and inet::IPv4NetworkConfigurator::readMulticastGroupConfiguration().

540 {
541  if (matchesany)
542  return true;
543  for (auto & matcher : matchers)
544  if (matcher->matches(s))
545  return true;
546 
547  return false;
548 }
bool matchesany
Definition: NetworkConfiguratorBase.h:131
std::vector< inet::PatternMatcher * > matchers
Definition: NetworkConfiguratorBase.h:132
value< double, units::s > s
Definition: Units.h:1049

Member Data Documentation

std::vector<inet::PatternMatcher *> inet::NetworkConfiguratorBase::Matcher::matchers
protected
bool inet::NetworkConfiguratorBase::Matcher::matchesany = false
protected

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