CARMA C++
AstroHdrElement.h
Go to the documentation of this file.
1 
12 #ifndef CARMA_SDP_ASTROHDRELEMENT_H
13 #define CARMA_SDP_ASTROHDRELEMENT_H
14 
15 #include <carma/util/types.h>
16 
17 #include <boost/shared_ptr.hpp>
18 
19 // C++ standard library includes
20 #include <map>
21 #include <string>
22 #include <vector>
23 
24 // Class definitions
25 namespace carma {
26 namespace sdp {
27 
28 // Forward declarations
29 class LineBuffer;
30 
31 class AstroHeaderElement;
32 typedef boost::shared_ptr<AstroHeaderElement> AstroHeaderElementPtr;
33 
34 enum AHW_Valtype {
35  A_STRING,
36  J_SHORT,
37  I_INT,
38  R_REAL,
39  D_DOUBLE,
40  C_COMPLEX,
41 };
42 
43 class AstroHeaderElement
44 {
45 public:
46  AstroHeaderElement(const std::string &name, const enum AHW_Valtype &type, const std::vector<std::string> &data);
47 
48  bool modified() const;
49  void modified(const bool b);
50 
54  friend LineBuffer &operator<<(LineBuffer& lb, const AstroHeaderElementPtr &elem);
55 
56 private:
57  const std::string name_;
58  const enum AHW_Valtype type_;
59 
60  const std::vector<std::string> data_;
61  size_t length_;
62 
63  bool modified_;
64 };
65 
66 class AstroHeaderElementMap : public std::map<std::string, AstroHeaderElementPtr>
67 {
68 public:
69  void putData(const std::string &name, const enum AHW_Valtype &type, const std::string &data);
70  void putData(const std::string &name, const enum AHW_Valtype &type, const std::vector<std::string> &data);
71 
75  void dumpTable(LineBuffer &file, const carma::util::frameType frameCount);
76 };
77 
78 } // namespace carma::sdp
79 } // namespace carma
80 
81 #endif
unsigned int frameType
Half second frames since Jan 1, 2000.
Definition: types.h:29
Various type definitions for util classes.