SickException.hh
Go to the documentation of this file.
1 
16 #ifndef SICK_EXCEPTION
17 #define SICK_EXCEPTION
18 
19 /* Definition dependencies */
20 #include <string>
21 #include <exception>
22 
23 /* Associate the namespace */
24 namespace SickToolbox {
25 
30  class SickException : std::exception {
31 
32  public:
33 
38  SickException( const std::string general_str ) {
39  _detailed_msg = general_str;
40  }
41 
47  SickException( const std::string general_str, const std::string detailed_str ) {
48  _detailed_msg = general_str + " " + detailed_str;
49  }
50 
54  virtual const char* what( ) const throw() {
55  return _detailed_msg.c_str();
56  }
57 
61  ~SickException() throw() {}
62 
63  private:
64 
66  std::string _detailed_msg;
67 
68  };
69 
75 
76  public:
77 
82  SickException("A Timeout Occurred!") { }
83 
88  SickTimeoutException( const std::string detailed_str ) :
89  SickException("A Timeout Occurred -",detailed_str) { }
90 
94  ~SickTimeoutException() throw() { }
95 
96  };
97 
104 
105  public:
106 
111  SickException("ERROR: I/O exception!") { }
112 
117  SickIOException( const std::string detailed_str ) :
118  SickException("ERROR: I/O exception -",detailed_str) { }
119 
123  ~SickIOException() throw() { }
124 
125  };
126 
133 
134  public:
135 
140  SickException("ERROR: Bad Checksum!") { }
141 
146  SickBadChecksumException( const std::string detailed_str ) :
147  SickException("ERROR: Bad Checksum -",detailed_str) { }
148 
153 
154  };
155 
162 
163  public:
164 
169  SickException("ERROR: Sick thread exception!") { }
170 
175  SickThreadException( const std::string detailed_str ) :
176  SickException("ERROR: Sick thread exception -",detailed_str) { }
177 
181  ~SickThreadException() throw() { }
182 
183  };
184 
191 
192  public:
193 
198  SickException("ERROR: Config exception!") { }
199 
204  SickConfigException( const std::string detailed_str ) :
205  SickException("ERROR: Config exception -",detailed_str) { }
206 
210  ~SickConfigException() throw() { }
211 
212  };
213 
220 
221  public:
222 
227  SickException("ERROR: Sick returned error code!") { };
228 
233  SickErrorException( const std::string detailed_str ) :
234  SickException("ERROR: Sick error -", detailed_str) { }
235 
239  ~SickErrorException() throw() { }
240 
241  };
242 } /* namespace SickToolbox */
243 
244 #endif /* SICK_EXCEPTION */
~SickException()
A destructor.
SickException(const std::string general_str, const std::string detailed_str)
A standard constructor.
SickIOException(const std::string detailed_str)
Another constructor.
SickException(const std::string general_str)
A standard constructor.
Thrown when Sick returns an error code or an unexpected response.
Provides a base exception class from which to derive other Sick exceptions.
virtual const char * what() const
From the standard exception library.
~SickIOException()
A destructor.
SickErrorException(const std::string detailed_str)
Another constructor.
SickThreadException(const std::string detailed_str)
Another constructor.
SickIOException()
A constructor.
SickTimeoutException(const std::string detailed_str)
A constructor.
Encapsulates the Sick LIDAR Matlab/C++ toolbox.
Definition: SickLD.cc:44
Thrown instance where the driver can&#39;t read,write,drain,flush,... the buffers.
SickBadChecksumException(const std::string detailed_str)
Another constructor.
Thrown when the driver detects (or the Sick reports) an invalid config.
Makes handling timeouts much easier.
SickConfigException(const std::string detailed_str)
Another constructor.
Thrown when error occurs during thread initialization, and uninitialization.
Thrown when a received message has an invalid checksum.


sicktoolbox
Author(s): Jason Derenick , Thomas Miller
autogenerated on Tue Sep 10 2019 03:37:34