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

◆ Matcher()

inet::MatrixCloudDelayer::Matcher::Matcher ( const char *  pattern)
21 {
22  matchesany = opp_isempty(pattern);
23  if (matchesany)
24  return;
25  cStringTokenizer tokenizer(pattern);
26  while (tokenizer.hasMoreTokens()) {
27  const char *token = tokenizer.nextToken();
28  matchers.push_back(new inet::PatternMatcher(token, true, true, true));
29  if (*token != '*') {
30  // add "*.token" too
31  std::string subtoken("*.");
32  subtoken += token;
33  matchers.push_back(new inet::PatternMatcher(subtoken.c_str(), true, true, true));
34  }
35  }
36 }

◆ ~Matcher()

inet::MatrixCloudDelayer::Matcher::~Matcher ( )
39 {
40  for (auto& elem : matchers)
41  delete elem;
42 }

Member Function Documentation

◆ matches()

bool inet::MatrixCloudDelayer::Matcher::matches ( const char *  s)
45 {
46  if (matchesany)
47  return true;
48  for (auto& elem : matchers)
49  if (elem->matches(s))
50  return true;
51 
52  return false;
53 }

◆ matchesAny()

bool inet::MatrixCloudDelayer::Matcher::matchesAny ( )
inline
35 { return matchesany; }

Member Data Documentation

◆ matchers

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

Referenced by Matcher().

◆ matchesany

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

Referenced by Matcher().


The documentation for this class was generated from the following files:
inet::MatrixCloudDelayer::Matcher::matchers
std::vector< inet::PatternMatcher * > matchers
Definition: MatrixCloudDelayer.h:29
inet::units::values::s
value< double, units::s > s
Definition: Units.h:1235
inet::MatrixCloudDelayer::Matcher::matchesany
bool matchesany
Definition: MatrixCloudDelayer.h:28
inet::PatternMatcher
Glob-style pattern matching class, adopted to special OMNeT++ requirements.
Definition: PatternMatcher.h:69