CARMA C++
carma::ui::rtd::CompositeMonitorTableVisitor Class Reference

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...
 
- Public Member Functions inherited from carma::ui::rtd::MonitorTableVisitor
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
 

Detailed Description

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.

Constructor & Destructor Documentation

carma::ui::rtd::CompositeMonitorTableVisitor::CompositeMonitorTableVisitor ( const std::vector< MonitorTableVisitorPtr > &  visitors)

Create an instance of a CompositeMonitorTableVisitor ahdering to the MonitorTableVisitor interface.

Parameters
visitorsVector containing composite visitors.
carma::ui::rtd::CompositeMonitorTableVisitor::~CompositeMonitorTableVisitor ( )

Destroy class instance.

Member Function Documentation

virtual bool carma::ui::rtd::CompositeMonitorTableVisitor::acceptMonitorPoint ( const monitor::MonitorPoint mp) const
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).

Parameters
mpMonitor point to test for acceptance.
virtual int carma::ui::rtd::CompositeMonitorTableVisitor::calcCellWidth ( const monitor::MonitorPoint mp) const
virtual

Calculate mp cell width.

If not redefined, this method returns the max of the contained visitors.

Parameters
mpMonitor 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.

Parameters
mpMonitor point associated with monitor cell.
monitorCellCell to apply user defined criteria to.

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