INET Framework for OMNeT++/OMNEST
inet::InterfaceMatcher::Selector Struct Reference

Public Member Functions

 Selector (const char *hostPattern, const char *namePattern, const char *towardsPattern, const InterfaceMatcher *parent)
 
bool matches (const InterfaceEntry *ie)
 

Public Attributes

Matcher hostMatcher
 
Matcher nameMatcher
 
Matcher towardsMatcher
 
const InterfaceMatcherparent
 

Constructor & Destructor Documentation

inet::InterfaceMatcher::Selector::Selector ( const char *  hostPattern,
const char *  namePattern,
const char *  towardsPattern,
const InterfaceMatcher parent 
)

Referenced by inet::InterfaceMatcher::InterfaceMatcher().

61  : hostMatcher(hostPattern), nameMatcher(namePattern), towardsMatcher(towardsPattern), parent(parent)
62 {
63 }
Matcher hostMatcher
Definition: InterfaceMatcher.h:65
const InterfaceMatcher * parent
Definition: InterfaceMatcher.h:68
Matcher nameMatcher
Definition: InterfaceMatcher.h:66
Matcher towardsMatcher
Definition: InterfaceMatcher.h:67

Member Function Documentation

bool inet::InterfaceMatcher::Selector::matches ( const InterfaceEntry ie)

Referenced by inet::InterfaceMatcher::findMatchingSelector().

67 {
68  cModule *hostModule = ie->getInterfaceTable()->getHostModule();
69  std::string hostFullPath = hostModule->getFullPath();
70  std::string hostShortenedFullPath = hostFullPath.substr(hostFullPath.find('.') + 1);
71 
72  return (hostMatcher.matchesAny() || hostMatcher.matches(hostShortenedFullPath.c_str()) || hostMatcher.matches(hostFullPath.c_str())) &&
73  (nameMatcher.matchesAny() || nameMatcher.matches(ie->getFullName())) &&
75 }
bool matchesAny() const
Definition: InterfaceMatcher.h:61
Matcher hostMatcher
Definition: InterfaceMatcher.h:65
const InterfaceMatcher * parent
Definition: InterfaceMatcher.h:68
Matcher nameMatcher
Definition: InterfaceMatcher.h:66
Matcher towardsMatcher
Definition: InterfaceMatcher.h:67
bool linkContainsMatchingHost(const InterfaceEntry *ie, const Matcher &hostMatcher) const
Definition: InterfaceMatcher.cc:134
bool matches(const char *s) const
Definition: InterfaceMatcher.cc:49

Member Data Documentation

Matcher inet::InterfaceMatcher::Selector::hostMatcher

Referenced by matches().

Matcher inet::InterfaceMatcher::Selector::nameMatcher

Referenced by matches().

const InterfaceMatcher* inet::InterfaceMatcher::Selector::parent

Referenced by matches().

Matcher inet::InterfaceMatcher::Selector::towardsMatcher

Referenced by matches().


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