INET Framework for OMNeT++/OMNEST
inet::visualizer::QueueVisualizerBase Class Referenceabstract

#include <QueueVisualizerBase.h>

Inheritance diagram for inet::visualizer::QueueVisualizerBase:
inet::visualizer::VisualizerBase inet::visualizer::QueueCanvasVisualizer inet::visualizer::QueueOsgVisualizer

Classes

class  QueueVisitor
 
class  QueueVisualization
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual void handleParameterChange (const char *name) override
 
virtual void refreshDisplay () const override
 
virtual QueueVisualizationcreateQueueVisualization (PacketQueue *queue) const =0
 
virtual void addQueueVisualization (const QueueVisualization *queueVisualization)
 
virtual void addQueueVisualizations ()
 
virtual void removeQueueVisualization (const QueueVisualization *queueVisualization)
 
virtual void refreshQueueVisualization (const QueueVisualization *queueVisualization) const =0
 
virtual void removeAllQueueVisualizations ()
 
- Protected Member Functions inherited from inet::visualizer::VisualizerBase
virtual int numInitStages () const override
 
virtual Coord getPosition (const cModule *networkNode) const
 
virtual Coord getContactPosition (const cModule *networkNode, const Coord &fromPosition, const char *contactMode, double contactSpacing) const
 
virtual InterfaceEntrygetInterfaceEntry (cModule *networkNode, cModule *module) const
 

Protected Attributes

std::vector< const QueueVisualization * > queueVisualizations
 
Parameters
bool displayQueues = false
 
QueueFilter queueFilter
 
cFigure::Color color
 
double width
 
double height
 
double spacing
 
Displacement displacementHint
 
double displacementPriority
 
- Protected Attributes inherited from inet::visualizer::VisualizerBase
cModule * visualizerTargetModule = nullptr
 
const char * tags = nullptr
 

Member Function Documentation

void inet::visualizer::QueueVisualizerBase::addQueueVisualization ( const QueueVisualization queueVisualization)
protectedvirtual

Reimplemented in inet::visualizer::QueueCanvasVisualizer.

Referenced by inet::visualizer::QueueCanvasVisualizer::addQueueVisualization(), and addQueueVisualizations().

72 {
73  queueVisualizations.push_back(queueVisualization);
74 }
std::vector< const QueueVisualization * > queueVisualizations
Definition: QueueVisualizerBase.h:66
void inet::visualizer::QueueVisualizerBase::addQueueVisualizations ( )
protectedvirtual

Referenced by handleParameterChange(), and initialize().

82 {
83  auto simulation = getSimulation();
84  QueueVisitor queueVisitor;
85  simulation->getSystemModule()->forEachChild(&queueVisitor);
86  for (auto queue : queueVisitor.queues) {
87  if (queueFilter.matches(queue))
89  }
90 }
virtual void addQueueVisualization(const QueueVisualization *queueVisualization)
Definition: QueueVisualizerBase.cc:71
bool matches(const PacketQueue *queue) const
Definition: QueueFilter.cc:29
QueueFilter queueFilter
Definition: QueueVisualizerBase.h:57
virtual QueueVisualization * createQueueVisualization(PacketQueue *queue) const =0
virtual QueueVisualization* inet::visualizer::QueueVisualizerBase::createQueueVisualization ( PacketQueue queue) const
protectedpure virtual
void inet::visualizer::QueueVisualizerBase::handleParameterChange ( const char *  name)
overrideprotectedvirtual
58 {
59  if (name != nullptr) {
62  }
63 }
virtual void removeAllQueueVisualizations()
Definition: QueueVisualizerBase.cc:92
virtual void addQueueVisualizations()
Definition: QueueVisualizerBase.cc:81
void inet::visualizer::QueueVisualizerBase::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::visualizer::VisualizerBase.

Reimplemented in inet::visualizer::QueueOsgVisualizer, and inet::visualizer::QueueCanvasVisualizer.

Referenced by inet::visualizer::QueueCanvasVisualizer::initialize().

38 {
40  if (!hasGUI()) return;
41  if (stage == INITSTAGE_LOCAL) {
42  displayQueues = par("displayQueues");
43  queueFilter.setPattern(par("queueFilter"));
44  color = cFigure::parseColor(par("color"));
45  width = par("width");
46  height = par("height");
47  spacing = par("spacing");
48  displacementHint = parseDisplacement(par("displacementHint"));
49  displacementPriority = par("displacementPriority");
50  }
51  else if (stage == INITSTAGE_LAST) {
52  if (displayQueues)
54  }
55 }
double width
Definition: QueueVisualizerBase.h:59
double spacing
Definition: QueueVisualizerBase.h:61
cFigure::Color color
Definition: QueueVisualizerBase.h:58
double displacementPriority
Definition: QueueVisualizerBase.h:63
Operations that no other initializations can depend on, e.g.
Definition: InitStages.h:111
virtual void initialize(int stage) override
Definition: VisualizerBase.cc:29
Displacement parseDisplacement(const char *s)
Definition: Displacement.cc:24
Local initializations.
Definition: InitStages.h:35
Displacement displacementHint
Definition: QueueVisualizerBase.h:62
virtual void addQueueVisualizations()
Definition: QueueVisualizerBase.cc:81
QueueFilter queueFilter
Definition: QueueVisualizerBase.h:57
void setPattern(const char *pattern)
Definition: QueueFilter.cc:24
bool displayQueues
Definition: QueueVisualizerBase.h:56
double height
Definition: QueueVisualizerBase.h:60
void inet::visualizer::QueueVisualizerBase::refreshDisplay ( ) const
overrideprotectedvirtual
66 {
67  for (auto queueVisualization : queueVisualizations)
68  refreshQueueVisualization(queueVisualization);
69 }
virtual void refreshQueueVisualization(const QueueVisualization *queueVisualization) const =0
std::vector< const QueueVisualization * > queueVisualizations
Definition: QueueVisualizerBase.h:66
virtual void inet::visualizer::QueueVisualizerBase::refreshQueueVisualization ( const QueueVisualization queueVisualization) const
protectedpure virtual
void inet::visualizer::QueueVisualizerBase::removeAllQueueVisualizations ( )
protectedvirtual

Referenced by handleParameterChange().

93 {
94  for (auto queueVisualization : queueVisualizations) {
95  removeQueueVisualization(queueVisualization);
96  delete queueVisualization;
97  }
98 }
virtual void removeQueueVisualization(const QueueVisualization *queueVisualization)
Definition: QueueVisualizerBase.cc:76
std::vector< const QueueVisualization * > queueVisualizations
Definition: QueueVisualizerBase.h:66
void inet::visualizer::QueueVisualizerBase::removeQueueVisualization ( const QueueVisualization queueVisualization)
protectedvirtual

Reimplemented in inet::visualizer::QueueCanvasVisualizer.

Referenced by removeAllQueueVisualizations(), and inet::visualizer::QueueCanvasVisualizer::removeQueueVisualization().

77 {
78  queueVisualizations.erase(std::remove(queueVisualizations.begin(), queueVisualizations.end(), queueVisualization), queueVisualizations.end());
79 }
void remove(std::vector< T > &v, const A &a)
Definition: stlutils.h:91
std::vector< const QueueVisualization * > queueVisualizations
Definition: QueueVisualizerBase.h:66

Member Data Documentation

cFigure::Color inet::visualizer::QueueVisualizerBase::color
protected
Displacement inet::visualizer::QueueVisualizerBase::displacementHint
protected
double inet::visualizer::QueueVisualizerBase::displacementPriority
protected
bool inet::visualizer::QueueVisualizerBase::displayQueues = false
protected

Referenced by initialize().

double inet::visualizer::QueueVisualizerBase::height
protected
QueueFilter inet::visualizer::QueueVisualizerBase::queueFilter
protected
std::vector<const QueueVisualization *> inet::visualizer::QueueVisualizerBase::queueVisualizations
protected
double inet::visualizer::QueueVisualizerBase::spacing
protected
double inet::visualizer::QueueVisualizerBase::width
protected

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