CARMA C++
|
Composite design pattern implementation for MonitorTableVisitor interface. More...
#include <carma/ui/rtd/common/CompositeMonitorTableVisitor.h>
Inherits carma::ui::rtd::MonitorTableVisitor.
Public Member Functions | |
virtual bool | acceptMonitorPoint (const monitor::MonitorPoint &mp) const |
Accept a monitor point. More... | |
virtual int | calcCellWidth (const monitor::MonitorPoint &mp) const |
Calculate mp cell width. More... | |
CompositeMonitorTableVisitor (const std::vector< MonitorTableVisitorPtr > &visitors) | |
Create an instance of a CompositeMonitorTableVisitor ahdering to the MonitorTableVisitor interface. More... | |
virtual ::std::string | generateRowLabel (const monitor::MonitorPoint &mp, bool showUnits) const |
Generate a row label for the input monitor point. More... | |
void | postprocessMonitorCell (const monitor::MonitorPoint &mp, MonitorCell &monitorCell) const |
Call postprocessMonitorCell for all contained visitors. More... | |
~CompositeMonitorTableVisitor () | |
Destroy class instance. More... | |
![]() | |
virtual bool | acceptMonitorPoint (const monitor::MonitorPoint &mp) const |
virtual int | calcCellWidth (const monitor::MonitorPoint &mp) const |
virtual ::std::string | generateRowLabel (const monitor::MonitorPoint &mp, bool showUnits) const |
virtual void | postprocessMonitorCell (const monitor::MonitorPoint &mp, MonitorCell &monitorCell) const |
Composite design pattern implementation for MonitorTableVisitor interface.
This class allows a user to define a single visitor composed of an arbitrary number of additional visitors all while still adhering to the visitor interface.
Definition at line 21 of file CompositeMonitorTableVisitor.h.
carma::ui::rtd::CompositeMonitorTableVisitor::CompositeMonitorTableVisitor | ( | const std::vector< MonitorTableVisitorPtr > & | visitors | ) |
Create an instance of a CompositeMonitorTableVisitor ahdering to the MonitorTableVisitor interface.
visitors | Vector containing composite visitors. |
carma::ui::rtd::CompositeMonitorTableVisitor::~CompositeMonitorTableVisitor | ( | ) |
Destroy class instance.
|
virtual |
Accept a monitor point.
If not redefined, this method ORs containing visitor implementations (e.g. it's true if any containing visitors are true).
mp | Monitor point to test for acceptance. |
|
virtual |
Calculate mp cell width.
If not redefined, this method returns the max of the contained visitors.
mp | Monitor point to calculate cell width for. |
virtual ::std::string carma::ui::rtd::CompositeMonitorTableVisitor::generateRowLabel | ( | const monitor::MonitorPoint & | mp, |
bool | showUnits | ||
) | const |
Generate a row label for the input monitor point.
If not redefined, this method returns the base class implementation (e.g. MonitorTableVisitor::generateRowLabel) which in turn just uses the monitor point short name.
void carma::ui::rtd::CompositeMonitorTableVisitor::postprocessMonitorCell | ( | const monitor::MonitorPoint & | mp, |
MonitorCell & | monitorCell | ||
) | const |
Call postprocessMonitorCell for all contained visitors.
This implementation should NOT be redefined! It is final in that any redefinition of it will effectively null and void this class's main purpose. Unfortunately, C++ does not contain a 'final' keyword which would make this explicit and enforceable.
mp | Monitor point associated with monitor cell. |
monitorCell | Cell to apply user defined criteria to. |