CARMA C++
Stage.h
Go to the documentation of this file.
1 // $Id: Stage.h,v 1.1 2011/08/18 23:25:52 abeard Exp $
2 
3 #ifndef CARMA_PIPELINE_STAGE_H
4 #define CARMA_PIPELINE_STAGE_H
5 
6 #include "carma/correlator/lib/CorrelatorDataPtr.h"
7 #include "carma/util/Time.h"
8 
9 #include <memory>
10 
21 namespace carma {
22 
23  namespace correlator {
24  namespace lib {
25  class CorrelatorBand;
26  class CorrelatorData;
27  } // namespace lib
28  } // namespace correlator
29 
30  namespace monitor {
31  class StageStats;
32  } // namespace monitor
33 
34  namespace pipeline {
35 
39  class Stage {
40  public:
41 
45  virtual ~Stage( );
46 
50  void activate( );
51 
55  void deactivate( );
56 
60  bool isStageActive( ) const;
61 
65  std::string getName( ) const;
66 
77  const carma::correlator::lib::CorrelatorDataPtr cd );
78 
87 
99  carma::correlator::lib::CorrelatorDataPtr
101  carma::correlator::lib::CorrelatorDataPtr cd );
102 
115  void fillStageMonitorData( );
116 
121  void fillMonitorStageStats( );
122 
123  protected:
124 
125  virtual void preprocess(
126  const carma::correlator::lib::CorrelatorDataPtr cd ) = 0;
127 
128  virtual void
129  processBand( carma::correlator::lib::CorrelatorBand * cb ) = 0;
130 
131  virtual carma::correlator::lib::CorrelatorDataPtr
132  postprocess( carma::correlator::lib::CorrelatorDataPtr cd ) = 0;
133 
142  virtual void fillMonitorData( ) = 0;
143 
149  explicit
150  Stage( carma::monitor::StageStats & stageStats,
151  const std::string & name );
152 
160 
161  private:
162 
163  Stage( const Stage & );
164  Stage & operator=( const Stage & );
165 
166  struct Pimpl;
167  const ::std::auto_ptr<Pimpl> pimpl_;
168 
169  }; // End class Stage
170 
171  } // namespace pipeline
172 } // namespace carma
173 
174 #endif // #ifndef CARMA_PIPELINE_STAGE_H
Base interface for a correlator pipeline stage.
Definition: Stage.h:39
Common time functions.
void processCorrelatorBand(carma::correlator::lib::CorrelatorBand *cb)
Process a single correlator band.
void activate()
Activate this stage.
virtual void fillMonitorData()=0
Fill in monitor data Implementor should count on this being called from a separate thread...
Class to hold a Band of Correlator Data.
unsigned int frameType
Half second frames since Jan 1, 2000.
Definition: types.h:29
void deactivate()
Deactivate this stage.
carma::util::frameType getDataFrameCount() const
Get correlator data frame count.
bool isStageActive() const
Is this stage active?
void preprocessCorrelatorData(const carma::correlator::lib::CorrelatorDataPtr cd)
Preprocess correlator data.
virtual ~Stage()
Destructor.
void fillMonitorStageStats()
Write internally stored and calculated stage stats.
carma::correlator::lib::CorrelatorDataPtr postprocessCorrelatorData(carma::correlator::lib::CorrelatorDataPtr cd)
Postprocess correlator data This is the final processing step for a stage and is called after process...
Stage(carma::monitor::StageStats &stageStats, const std::string &name)
Constructor.
std::string getName() const
Get name of stage.
void fillStageMonitorData()
Fill per stage monitor data.