CARMA C++
PipelineSubsystemTemplate.h
1 #ifndef CARMA_MONITOR_PIPELINESUBSYSTEMTEMPLATE_H
2 #define CARMA_MONITOR_PIPELINESUBSYSTEMTEMPLATE_H
3 
5 
6 #include "carma/util/Trace.h"
7 
8 namespace carma {
9 namespace monitor {
10 
14  template < typename S >
16  public:
17 
18  explicit PipelineSubsystemTemplate( );
19 
20  explicit PipelineSubsystemTemplate( S & pl );
21 
22  virtual ~PipelineSubsystemTemplate( );
23 
27  int getBandCount( ) const;
28 
29  carma::monitor::PipelineStatus &
30  getPipelineStatus( ) const;
31 
32  carma::monitor::StageStats &
33  getCatchDataStageStats( ) const;
34 
35  carma::monitor::CatchDataStage &
36  getCatchDataStage( ) const;
37 
38  carma::monitor::CatchDataBand &
39  getCatchDataBand( int bandIdx ) const;
40 
41  carma::monitor::StageStats &
42  getCoherenceStageStats( ) const;
43 
44  carma::monitor::StageStats &
45  getDecimationStageStats( ) const;
46 
50  carma::monitor::Decimation &
51  getDecimation( int bandIdx ) const;
52 
53  carma::monitor::SelfCal &
54  getSelfCal( int bandIdx, bool usb ) const;
55 
56  carma::monitor::StageStats &
57  getPassBandStageStats( ) const;
58 
59  carma::monitor::StageStats &
60  getTsysStageStats( ) const;
61 
62  carma::monitor::TsysStage &
63  getTsysStage( ) const;
64 
65  carma::monitor::StageStats &
66  getBlankFlagStageStats( ) const;
67 
68  carma::monitor::BlankFlagStage &
69  getBlankFlagStage( ) const;
70 
71  carma::monitor::StageStats &
72  getLinelengthStageStats( ) const;
73 
74  carma::monitor::StageStats &
75  getIFcorrectionStageStats( ) const;
76 
77  carma::monitor::StageStats &
78  getWvrStageStats( ) const;
79 
80  carma::monitor::StageStats &
81  getSelfCalStageStats( ) const;
82 
83  carma::monitor::StageStats &
84  getCorrelatorPublisherStageStats( ) const;
85 
86  carma::monitor::CorrelatorPublisherStage &
87  getCorrelatorPublisherStage( ) const;
88 
89  carma::monitor::StageStats &
90  getIntegratorStageStats( ) const;
91 
92  carma::monitor::IntegratorStage &
93  getIntegratorStage( ) const;
94 
95  carma::monitor::StageStats &
96  getVisBrickStageStats( ) const;
97 
98  carma::monitor::VisBrickStage &
99  getVisBrickStage( ) const;
100 
104  carma::monitor::LastIntegration& lastIntegration() const;
105 
110  void startAutoWriter( float delay );
111 
115  void stopAutoWriter( );
116 
120  bool autoWriterIsAlive() const;
121 
126  void write( );
127 
128  protected:
129 
130  // Nothing protected
131 
132  private:
133 
134  // Disallow copying - especially important with auto_ptr.
136  PipelineSubsystemTemplate & operator=(
137  const PipelineSubsystemTemplate & );
138 
139  // ORDER DEPENDENCY .
140  ::std::auto_ptr<S> pipelineStorage_;
141  S & pipeline_;
142  // END ORDER DEPENDENCY .
143 
144  }; // End class PipelineSubsystem
145 } // End namespace monitor
146 } // End namespace carma
147 
148 // ========================== Implementation Only ==============================
149 
150 template< typename S>
151 inline
153  : // ORDER DEPENDENCY
154  pipelineStorage_( new S ),
155  pipeline_( *( pipelineStorage_.get( ) ) )
156  // END ORDER DEPENDENCY
157 { }
158 
159 template< typename S>
160 inline
162  S & pl ) : pipelineStorage_( ), pipeline_( pl )
163 {
164  CARMA_CPTRACE( carma::util::Trace::TRACE3, "~PipelineSubsystemTemplate" );
165 }
166 
167 template< typename S>
168 inline
170 { }
171 
172 template< typename S>
173 inline
174 carma::monitor::PipelineStatus &
176 {
177  return pipeline_.pipelineStatus( );
178 }
179 
180 template< typename S>
181 inline
182 carma::monitor::StageStats &
184 {
185  return pipeline_.catchDataStageContainer( ).stageStats( );
186 }
187 
188 template< typename S>
189 inline
190 carma::monitor::CatchDataStage &
192 {
193  return pipeline_.catchDataStageContainer( ).catchDataStage( );
194 }
195 
196 template< typename S >
197 inline
198 carma::monitor::CatchDataBand &
200  const int bandIdx ) const
201 {
202  return pipeline_.catchDataBandContainer( bandIdx ).catchDataBand();
203 }
204 
205 template< typename S >
206 inline
207 carma::monitor::StageStats &
210 {
211  return pipeline_.coherenceStageContainer( ).stageStats( );
212 }
213 
214 template< typename S >
215 inline
216 carma::monitor::StageStats &
219 {
220  return pipeline_.decimatorStageContainer( ).stageStats( );
221 }
222 
223 template< typename S >
224 inline
225 carma::monitor::Decimation &
227  const int bandIdx ) const
228 {
229  return pipeline_.decimationBandContainer( bandIdx ).decimation( );
230 }
231 
232 template< typename S >
233 inline
234 carma::monitor::SelfCal &
236  const int bandIdx, const bool usb ) const
237 {
238  if ( usb )
239  return pipeline_.selfCalUsbIntegContainer( bandIdx ).selfCal( );
240  else
241  return pipeline_.selfCalLsbIntegContainer( bandIdx ).selfCal( );
242 }
243 
244 template< typename S >
245 inline
246 carma::monitor::StageStats &
248 {
249  return pipeline_.passBandStageContainer( ).stageStats( );
250 }
251 
252 template< typename S >
253 inline
254 carma::monitor::StageStats &
256 {
257  return pipeline_.tsysStageContainer( ).stageStats( );
258 }
259 
260 template< typename S >
261 inline
262 carma::monitor::TsysStage &
264 {
265  return pipeline_.tsysStageContainer( ).tsysStage( );
266 }
267 
268 template< typename S >
269 inline
270 carma::monitor::StageStats &
272 {
273  return pipeline_.blankFlagStageContainer( ).stageStats( );
274 }
275 
276 template< typename S >
277 inline
278 carma::monitor::BlankFlagStage &
280 {
281  return pipeline_.blankFlagStageContainer( ).blankFlagStage( );
282 }
283 
284 template< typename S >
285 inline
286 carma::monitor::StageStats &
288 {
289  return pipeline_.linelengthStageContainer( ).stageStats( );
290 }
291 
292 template< typename S >
293 inline
294 carma::monitor::StageStats &
297 {
298  return pipeline_.iFcorrectionStageContainer( ).stageStats( );
299 }
300 
301 template< typename S >
302 inline
303 carma::monitor::StageStats &
305 {
306  return pipeline_.wvrStageContainer( ).stageStats( );
307 }
308 
309 template< typename S >
310 inline
311 carma::monitor::StageStats &
313 {
314  return pipeline_.selfCalIntegStageContainer( ).stageStats( );
315 }
316 
317 template< typename S >
318 inline
319 carma::monitor::StageStats &
322 {
323  return pipeline_.correlatorPublisherContainer( ).stageStats( );
324 }
325 
326 template< typename S >
327 inline
328 carma::monitor::CorrelatorPublisherStage &
331 {
332  return pipeline_.correlatorPublisherContainer().correlatorPublisherStage();
333 }
334 
335 template< typename S >
336 inline
337 carma::monitor::StageStats &
339 {
340  return pipeline_.integratorStageContainer( ).stageStats( );
341 }
342 
343 template< typename S >
344 inline
345 carma::monitor::IntegratorStage &
347 {
348  return pipeline_.integratorStageContainer( ).integratorStage( );
349 }
350 
351 template< typename S >
352 inline
353 carma::monitor::StageStats &
355 {
356  return pipeline_.visBrickStageContainer( ).stageStats( );
357 }
358 
359 template< typename S >
360 inline
361 carma::monitor::VisBrickStage &
363 {
364  return pipeline_.visBrickStageContainer( ).visBrickStage( );
365 }
366 
367 template< typename S >
368 inline
369 int
371 {
372  return S::catchDataBandContainerCount( );
373 }
374 
375 template< typename S >
376 inline
377 carma::monitor::LastIntegration &
379 {
380  return pipeline_.lastIntegration();
381 }
382 
383 template< typename S>
384 inline
385 void
387 {
388  pipeline_.startAutoWriter( delay );
389 }
390 
391 template< typename S>
392 inline
393 void
395 {
396  pipeline_.stopAutoWriter( );
397 }
398 
399 template< typename S>
400 inline
401 bool
403 {
404  return pipeline_.autoWriterIsAlive( );
405 }
406 
407 template< typename S>
408 inline
409 void
411 {
412  pipeline_.writeWithoutResettingValidities( );
413 }
414 
415 #endif
#define CARMA_CPTRACE(priorityLevel, message)
Macro for people who just want to use the Trace object created for them in carma::util::Program.
Definition: Trace.h:59
Interface file for the carma::util::Trace class and related macros.
bool autoWriterIsAlive() const
Check to see if the autowriter is alive.
Abstract base class for retrieving pipeline monitor system components common between the spectral lin...
void write()
Write frame data Use when not using autowriter.
int getBandCount() const
Retrieve band count - differs among wb and sl systems.
carma::monitor::LastIntegration & lastIntegration() const
Retrieve reference to lastIntegration container.
Templatized implementation of PipelineSubsystem interface.
void startAutoWriter(float delay)
Start the monitor system auto writer (automatically writes data to the Frame Scriber Publisher every ...
carma::monitor::Decimation & getDecimation(int bandIdx) const
Retrieve a reference to common Decimation container.