CARMA C++
PipelineTransport.h
1 /*
2  * Shared memory transport of MIRIAD Blank/Flag reasons from the CARMA pipeline
3  */
4 
5 #ifndef CARMA_PIPELINE_TRANSPORT_H
6 #define CARMA_PIPELINE_TRANSPORT_H
7 
8 #include <carma/pipeline/pipelineUtils.h>
9 #include <boost/shared_ptr.hpp>
10 #include <stdint.h>
11 
12 namespace carma {
13 namespace pipeline {
14 
15 // forward declaration
16 class PipelineBFIPQ;
17 
18 /*----------------------------------------------------------------------------*/
19 /* Pipeline Transport Writer -- for exclusive use by the pipeline */
20 /*----------------------------------------------------------------------------*/
21 
22 class PipelineTransportWriter
23 {
24  public:
25  PipelineTransportWriter(const enum PipelineType pt);
26 
27  /* clear existing status */
28  void clear();
29 
30  /* write out the current data */
31  void write();
32 
43  void setBaseline(const unsigned int bandno,
44  const unsigned int antno1, const unsigned int antno2,
45  const bool islsb, uint32_t flags);
46 
47  protected:
48  boost::shared_ptr<PipelineBFIPQ> ipq_;
49 };
50 
51 /*----------------------------------------------------------------------------*/
52 /* Pipeline Transport Reader -- for use by any readers (usually RTDs) */
53 /*----------------------------------------------------------------------------*/
54 
55 class PipelineTransportReader
56 {
57  public:
58  PipelineTransportReader(const enum PipelineType pt);
59 
60  /* blocking read */
61  void read();
62 
63  /* non-blocking read */
64  void readNewest();
65 
76  uint32_t getBaseline(const unsigned int bandno,
77  const unsigned int antno1, const unsigned int antno2,
78  const bool islsb) const;
79 
80  protected:
81  boost::shared_ptr<PipelineBFIPQ> ipq_;
82 };
83 
84 } // namespace carma::pipeline
85 } // namespace carma
86 
87 #endif /* CARMA_PIPELINE_TRANSPORT_H */
88 
89 /* vim: set ts=8 sts=8 sw=8 noet tw=92: */