CARMA C++
TelemetryConfigHandler.h
Go to the documentation of this file.
1 
10 #ifndef CARMA_ANTENNA_BIMA_TELEMETRYCONFIGHANDLER_H
11 #define CARMA_ANTENNA_BIMA_TELEMETRYCONFIGHANDLER_H
12 
13 
14 
15 #include <xercesc/sax/AttributeList.hpp>
16 #include <xercesc/sax/HandlerBase.hpp>
17 
18 #include <string>
19 #include <vector>
20 #include <map>
21 
22 #include <stdlib.h>
23 
24 #include "carma/canbus/Utilities.h"
25 #include "carma/util/StrX.h"
26 #include "carma/util/Trace.h"
28 
30 
31 XERCES_CPP_NAMESPACE_USE
32 
33 typedef std::map<carma::canbus::msgType, carma::antenna::bima::TelemetryInfo *> tmMap;
34 
35 namespace carma
36 {
37  namespace antenna
38  {
39  namespace bima
40  {
41  class TelemetryConfigHandler : public HandlerBase
42  {
43 
44  private:
45  tmMap _info;
46  std::vector<short> _addrCheck;
47  bool _check;
48  std::string _version;
49 
50  public:
51  TelemetryConfigHandler( bool check = false );
52 
53  ~TelemetryConfigHandler();
54 
55  TelemetryInfo *getInfo( carma::canbus::msgType mid )
56  {
57  if ( _info.find( mid ) != _info.end() )
58  {
59  return _info[mid];
60  }
61  else
62  {
63  return (TelemetryInfo *)0;
64  }
65  }
66 
67 
68  tmMap::iterator begin() { return _info.begin(); }
69  tmMap::iterator end() { return _info.end(); }
70 
71  std::string getTelemetryVersion();
72 
73  // startDocument DocumentHandler overload
74  void startDocument();
75 
76  // startElement DocumentHandler overload
77  void startElement(const XMLCh* const name, AttributeList& attributes);
78 
79  // endElement DocumentHandler overload
80  void endElement(const XMLCh* const name);
81 
82  // endDocument DocumentHandler overload
83  void endDocument();
84 
85  // warning SAX ErrorHandler implementation
86  void warning(const SAXParseException& exception);
87 
88  // error SAX ErrorHandler implementation
89  void error(const SAXParseException& exception);
90 
91  // fatalError SAX ErrorHandler implementation
92  void fatalError(const SAXParseException& exception);
93 
94  }; // class TelemetryConfigHandler
95  } // namespace bima
96  } // namespace antenna
97 } // namespace carma
98 
99 #endif // CARMA_ANTENNA_BIMA_TELEMETRYCONFIGHANDLER_H
Exception class for errors.
Interface file for the carma::util::Trace class and related macros.
Declarations of carma::canbus utility functions.
unsigned short msgType
Carma Message id type.
Definition: Types.h:69