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

#include <MatrixCloudDelayer.h>

Public Member Functions

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

Private Attributes

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

Constructor & Destructor Documentation

inet::MatrixCloudDelayer::Matcher::Matcher ( const char *  pattern)
57 {
58  matchesany = isEmpty(pattern);
59  if (matchesany)
60  return;
61  cStringTokenizer tokenizer(pattern);
62  while (tokenizer.hasMoreTokens()) {
63  const char *token = tokenizer.nextToken();
64  matchers.push_back(new inet::PatternMatcher(token, true, true, true));
65  if (*token != '*') {
66  // add "*.token" too
67  std::string subtoken("*.");
68  subtoken += token;
69  matchers.push_back(new inet::PatternMatcher(subtoken.c_str(), true, true, true));
70  }
71  }
72 }
std::vector< inet::PatternMatcher * > matchers
Definition: MatrixCloudDelayer.h:43
bool matchesany
Definition: MatrixCloudDelayer.h:42
Glob-style pattern matching class, adopted to special OMNeT++ requirements.
Definition: PatternMatcher.h:78
bool isEmpty(const char *s)
Definition: L2NetworkConfigurator.cc:35
inet::MatrixCloudDelayer::Matcher::~Matcher ( )
75 {
76  for (auto & elem : matchers)
77  delete elem;
78 }
std::vector< inet::PatternMatcher * > matchers
Definition: MatrixCloudDelayer.h:43

Member Function Documentation

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

Referenced by inet::MatrixCloudDelayer::MatrixEntry::matches().

81 {
82  if (matchesany)
83  return true;
84  for (auto & elem : matchers)
85  if (elem->matches(s))
86  return true;
87 
88  return false;
89 }
std::vector< inet::PatternMatcher * > matchers
Definition: MatrixCloudDelayer.h:43
bool matchesany
Definition: MatrixCloudDelayer.h:42
value< double, units::s > s
Definition: Units.h:1049
bool inet::MatrixCloudDelayer::Matcher::matchesAny ( )
inline
49 { return matchesany; }
bool matchesany
Definition: MatrixCloudDelayer.h:42

Member Data Documentation

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

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

bool inet::MatrixCloudDelayer::Matcher::matchesany
private

Referenced by Matcher(), and matches().


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