SerialException.h
Go to the documentation of this file.
00001 /*
00002  * SerialException.h
00003  *
00004  *  Created on: Oct 13, 2011
00005  *      Author: mriedel
00006  */
00007 
00008 #ifndef SERIALEXCEPTION_H_
00009 #define SERIALEXCEPTION_H_
00010 
00011 #include <telekyb_defines/telekyb_defines.hpp>
00012 // enum
00013 #include <telekyb_defines/telekyb_enums.hpp>
00014 
00015 #include <exception>
00016 
00017 // ros
00018 #include <ros/console.h>
00019 
00020 namespace TELEKYB_NAMESPACE
00021 {
00022 
00023 TELEKYB_ENUM(SerialExceptionCode,
00024                 (NO_ERROR)
00025                 (UNABLE_TO_OPEN)
00026                 (LOCKED)
00027                 (NO_TTY)
00028                 (IO_ERROR)
00029                 (GENERAL_ERROR))
00030 
00031 
00032 class SerialException : public std::exception {
00033 protected:
00034         std::string msg;
00035         ros::console::Level level;
00036         bool processed;
00037 
00038 public:
00039         SerialException(const std::string& msg_,
00040                         SerialExceptionCode code_ = SerialExceptionCode::GENERAL_ERROR,
00041                         ros::console::Level level_ = ros::console::levels::Error);
00042         virtual ~SerialException() throw();
00043 
00044         // Prints ROS Message with Level. Fatal halts execution
00045         void process();
00046 
00047         // ErrorCode
00048         SerialExceptionCode code;
00049 };
00050 
00051 } // namespace
00052 
00053 #endif /* SERIALEXCEPTION_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Defines


telekyb_serial
Author(s): Martin Riedel
autogenerated on Mon Nov 11 2013 11:14:08