CARMA C++
CompositeMonitorTableVisitor.h
1 #ifndef CARMA_UI_RTD_COMPOSITE_MONITOR_TABLE_VISITOR_H
2 #define CARMA_UI_RTD_COMPOSITE_MONITOR_TABLE_VISITOR_H
3 
4 #include "carma/ui/rtd/common/MonitorTableVisitor.h"
5 
6 #include <vector>
7 
8 #include <boost/shared_ptr.hpp>
9 
10 namespace carma {
11 namespace ui {
12 namespace rtd {
13 
21 class CompositeMonitorTableVisitor : public MonitorTableVisitor {
22 public:
23 
30  const std::vector<MonitorTableVisitorPtr > & visitors );
31 
36 
43  virtual bool acceptMonitorPoint( const monitor::MonitorPoint & mp ) const;
44 
50  virtual int calcCellWidth( const monitor::MonitorPoint & mp ) const;
51 
62  const monitor::MonitorPoint & mp,
63  MonitorCell & monitorCell ) const;
64 
71  virtual ::std::string generateRowLabel(
72  const monitor::MonitorPoint & mp,
73  bool showUnits ) const;
74 
75 private:
76 
77  typedef ::std::vector< MonitorTableVisitorPtr > VisitorVector;
78 
79  VisitorVector visitors_;
80 
81 }; // class CompositeMonitorTableVisitor
82 
83 typedef boost::shared_ptr<CompositeMonitorTableVisitor> CompositeMonitorTableVisitorPtr;
84 
85 } // namespace carma::ui::rtd
86 } // namespace carma::ui
87 } // namespace carma
88 #endif
Composite design pattern implementation for MonitorTableVisitor interface.
virtual bool acceptMonitorPoint(const monitor::MonitorPoint &mp) const
Accept a monitor point.
CompositeMonitorTableVisitor(const std::vector< MonitorTableVisitorPtr > &visitors)
Create an instance of a CompositeMonitorTableVisitor ahdering to the MonitorTableVisitor interface...
Abstract base class for a monitor point.
Definition: MonitorPoint.h:68
virtual int calcCellWidth(const monitor::MonitorPoint &mp) const
Calculate mp cell width.
virtual ::std::string generateRowLabel(const monitor::MonitorPoint &mp, bool showUnits) const
Generate a row label for the input monitor point.
A Cell that displays the current value of a MonitorPoint, with the background color gotten from a sec...
Definition: MonitorCell.h:55
void postprocessMonitorCell(const monitor::MonitorPoint &mp, MonitorCell &monitorCell) const
Call postprocessMonitorCell for all contained visitors.
~CompositeMonitorTableVisitor()
Destroy class instance.