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

#include <MatrixCloudDelayer.h>

Public Member Functions

 MatrixEntry (cXMLElement *trafficEntity, bool defaultSymmetric)
 
 ~MatrixEntry ()
 
bool matches (const char *src, const char *dest)
 

Public Attributes

Matcher srcMatcher
 
Matcher destMatcher
 
bool symmetric = false
 
cDynamicExpression delayPar
 
cDynamicExpression dataratePar
 
cDynamicExpression dropPar
 
cXMLElement * entity = nullptr
 

Constructor & Destructor Documentation

◆ MatrixEntry()

inet::MatrixCloudDelayer::MatrixEntry::MatrixEntry ( cXMLElement *  trafficEntity,
bool  defaultSymmetric 
)
55  :
56  srcMatcher(trafficEntity->getAttribute("src")), destMatcher(trafficEntity->getAttribute("dest"))
57 {
58  const char *delayAttr = trafficEntity->getAttribute("delay");
59  const char *datarateAttr = trafficEntity->getAttribute("datarate");
60  const char *dropAttr = trafficEntity->getAttribute("drop");
61  symmetric = xmlutils::getAttributeBoolValue(trafficEntity, "symmetric", defaultSymmetric);
62  try {
63  delayPar.parse(delayAttr);
64  }
65  catch (std::exception& e) {
66  throw cRuntimeError("parser error '%s' in 'delay' attribute of '%s' entity at %s", e.what(), trafficEntity->getTagName(), trafficEntity->getSourceLocation());
67  }
68  try {
69  dataratePar.parse(datarateAttr);
70  }
71  catch (std::exception& e) {
72  throw cRuntimeError("parser error '%s' in 'datarate' attribute of '%s' entity at %s", e.what(), trafficEntity->getTagName(), trafficEntity->getSourceLocation());
73  }
74  try {
75  dropPar.parse(dropAttr);
76  }
77  catch (std::exception& e) {
78  throw cRuntimeError("parser error '%s' in 'drop' attribute of '%s' entity at %s", e.what(), trafficEntity->getTagName(), trafficEntity->getSourceLocation());
79  }
80 }

◆ ~MatrixEntry()

inet::MatrixCloudDelayer::MatrixEntry::~MatrixEntry ( )
inline
50 {}

Member Function Documentation

◆ matches()

bool inet::MatrixCloudDelayer::MatrixEntry::matches ( const char *  src,
const char *  dest 
)
83 {
84  if (srcMatcher.matches(src) && destMatcher.matches(dest))
85  return true;
86  if (symmetric && srcMatcher.matches(dest) && destMatcher.matches(src))
87  return true;
88  return false;
89 }

Referenced by inet::MatrixCloudDelayer::getOrCreateDescriptor().

Member Data Documentation

◆ dataratePar

cDynamicExpression inet::MatrixCloudDelayer::MatrixEntry::dataratePar

◆ delayPar

cDynamicExpression inet::MatrixCloudDelayer::MatrixEntry::delayPar

◆ destMatcher

Matcher inet::MatrixCloudDelayer::MatrixEntry::destMatcher

◆ dropPar

cDynamicExpression inet::MatrixCloudDelayer::MatrixEntry::dropPar

◆ entity

cXMLElement* inet::MatrixCloudDelayer::MatrixEntry::entity = nullptr

◆ srcMatcher

Matcher inet::MatrixCloudDelayer::MatrixEntry::srcMatcher

◆ symmetric

bool inet::MatrixCloudDelayer::MatrixEntry::symmetric = false

The documentation for this class was generated from the following files:
inet::units::constants::e
const value< double, units::C > e(1.602176487e-19)
inet::MatrixCloudDelayer::MatrixEntry::destMatcher
Matcher destMatcher
Definition: MatrixCloudDelayer.h:41
inet::MatrixCloudDelayer::MatrixEntry::dropPar
cDynamicExpression dropPar
Definition: MatrixCloudDelayer.h:45
inet::xmlutils::getAttributeBoolValue
bool getAttributeBoolValue(const cXMLElement *node, const char *attrName, bool defVal)
Definition: XMLUtils.cc:169
inet::MatrixCloudDelayer::MatrixEntry::delayPar
cDynamicExpression delayPar
Definition: MatrixCloudDelayer.h:43
inet::MatrixCloudDelayer::Matcher::matches
bool matches(const char *s)
Definition: MatrixCloudDelayer.cc:44
inet::MatrixCloudDelayer::MatrixEntry::symmetric
bool symmetric
Definition: MatrixCloudDelayer.h:42
inet::MatrixCloudDelayer::MatrixEntry::dataratePar
cDynamicExpression dataratePar
Definition: MatrixCloudDelayer.h:44
inet::MatrixCloudDelayer::MatrixEntry::srcMatcher
Matcher srcMatcher
Definition: MatrixCloudDelayer.h:40