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

inet::MatrixCloudDelayer::MatrixEntry::MatrixEntry ( cXMLElement *  trafficEntity,
bool  defaultSymmetric 
)

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

91  :
92  srcMatcher(trafficEntity->getAttribute("src")), destMatcher(trafficEntity->getAttribute("dest"))
93 {
94  const char *delayAttr = trafficEntity->getAttribute("delay");
95  const char *datarateAttr = trafficEntity->getAttribute("datarate");
96  const char *dropAttr = trafficEntity->getAttribute("drop");
97  symmetric = getBoolAttribute(*trafficEntity, "symmetric", &defaultSymmetric);
98  try {
99  delayPar.parse(delayAttr);
100  }
101  catch (std::exception& e) {
102  throw cRuntimeError("parser error '%s' in 'delay' attribute of '%s' entity at %s", e.what(), trafficEntity->getTagName(), trafficEntity->getSourceLocation());
103  }
104  try {
105  dataratePar.parse(datarateAttr);
106  }
107  catch (std::exception& e) {
108  throw cRuntimeError("parser error '%s' in 'datarate' attribute of '%s' entity at %s", e.what(), trafficEntity->getTagName(), trafficEntity->getSourceLocation());
109  }
110  try {
111  dropPar.parse(dropAttr);
112  }
113  catch (std::exception& e) {
114  throw cRuntimeError("parser error '%s' in 'drop' attribute of '%s' entity at %s", e.what(), trafficEntity->getTagName(), trafficEntity->getSourceLocation());
115  }
116 }
cDynamicExpression dataratePar
Definition: MatrixCloudDelayer.h:59
bool symmetric
Definition: MatrixCloudDelayer.h:57
Matcher destMatcher
Definition: MatrixCloudDelayer.h:56
Matcher srcMatcher
Definition: MatrixCloudDelayer.h:55
const value< double, units::C > e(1.602176487e-19)
cDynamicExpression dropPar
Definition: MatrixCloudDelayer.h:60
cDynamicExpression delayPar
Definition: MatrixCloudDelayer.h:58
inet::MatrixCloudDelayer::MatrixEntry::~MatrixEntry ( )
inline
65 {}

Member Function Documentation

bool inet::MatrixCloudDelayer::MatrixEntry::matches ( const char *  src,
const char *  dest 
)

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

119 {
120  if (srcMatcher.matches(src) && destMatcher.matches(dest))
121  return true;
122  if (symmetric && srcMatcher.matches(dest) && destMatcher.matches(src))
123  return true;
124  return false;
125 }
bool matches(const char *s)
Definition: MatrixCloudDelayer.cc:80
bool symmetric
Definition: MatrixCloudDelayer.h:57
Matcher destMatcher
Definition: MatrixCloudDelayer.h:56
Matcher srcMatcher
Definition: MatrixCloudDelayer.h:55

Member Data Documentation

cDynamicExpression inet::MatrixCloudDelayer::MatrixEntry::dataratePar
cDynamicExpression inet::MatrixCloudDelayer::MatrixEntry::delayPar
Matcher inet::MatrixCloudDelayer::MatrixEntry::destMatcher

Referenced by matches().

cDynamicExpression inet::MatrixCloudDelayer::MatrixEntry::dropPar
cXMLElement* inet::MatrixCloudDelayer::MatrixEntry::entity = nullptr
Matcher inet::MatrixCloudDelayer::MatrixEntry::srcMatcher

Referenced by matches().

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

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