CARMA C++
AntennaException.h
Go to the documentation of this file.
1 #ifndef ANTENNAEXCEPTION_H
2 #define ANTENNAEXCEPTION_H
3 
12 
13 namespace sza {
14  namespace antenna {
15  namespace control {
16 
17  class AntennaException : sza::util::Exception {
18  public:
19 
20  enum Type {
21  PMAC,
22  UNKNOWN,
23  };
24 
32  inline AntennaException(std::string str, const char * fileName,
33  const int lineNumber, Type type) :
34  sza::util::Exception(str, fileName, lineNumber, true), type_(type) {}
35 
43  inline AntennaException(std::ostringstream& os, const char * fileName,
44  const int lineNumber, Type type) :
45  sza::util::Exception(os, fileName, lineNumber, true), type_(type) {}
46 
50  inline AntennaException(sza::util::LogStream& ls,
51  const char* fileName, const int lineNumber,
52  Type type) :
53  sza::util::Exception(ls, fileName, lineNumber, true), type_(type) {}
54 
58  inline AntennaException(sza::util::LogStream* ls,
59  const char* fileName, const int lineNumber,
60  Type type) :
61  sza::util::Exception(ls, fileName, lineNumber, true), type_(type) {}
62 
66  inline void setPmac() {type_ = PMAC;}
67 
71  inline bool isPmac() {return type_ == PMAC;}
72 
73  private:
74 
75  Type type_;
76 
77  }; // End class AntennaException
78 
79  }; // End namespace control
80  }; // End namespace antenna
81 }; // End namespace sza
82 
83 #define AntError(x) AntennaException((x), __FILE__, __LINE__, \
84 AntennaException::UNKNOWN)
85 
86 #define AntErrorDef(x,y) AntennaException (x)((y), __FILE__, __LINE__, \
87 AntennaException::UNKNOWN))
88 
89 #define PmacError(x) AntennaException((x), __FILE__, __LINE__, \
90 AntennaException::PMAC)
91 
92 #define PmacErrorDef(x,y) AntennaException (x)((y), __FILE__, __LINE__, \
93 AntennaException::PMAC))
94 
95 #endif // End #ifndef
96 
97 
Tagged: Fri Nov 14 12:39:33 UTC 2003.