cdlCOMExceptions.h
Go to the documentation of this file.
1 //
2 // C++ Interface: cdlCOMExceptions
3 //
4 // Description:
5 //
6 //
7 // Author: Tiziano Müller <tiziano.mueller@neuronics.ch>, (C) 2006
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12 
13 #ifndef _CDLCOMEXCEPTIONS_H_
14 #define _CDLCOMEXCEPTIONS_H_
15 
16 #include "common/exception.h"
17 #include <string>
18 
20 enum{
21  ERR_FAILED = -1,
31  ERR_AXIS_ANY = -11,
32  ERR_CRC = -12,
34  ERR_MESSAGE = 192,
36 };
37 
42 
48 public:
49  CannotOpenPortException(const std::string & port, const std::string os_msg) throw ():
50  Exception("Cannot open port '" + port + "': " + os_msg, -10) {}
51 };
52 
57 public:
58  CannotGetSetPortAttributesException(const std::string & port) throw ():
59  Exception("Cannot get/set attributes on '" + port + "'", -11) {}
60 };
61 
66 public:
67  PortNotOpenException(const std::string & port) throw ():
68  Exception("Port '" + port + "' not open", -12) {}
69 };
70 
76 public:
77  DeviceReadException(const std::string & port, const std::string os_msg) throw ():
78  Exception("Read failure on port '" + port + "': " + os_msg, -13) {}
79 };
80 
86 public:
87  DeviceWriteException(const std::string & port, const std::string os_msg) throw ():
88  Exception("Write failure on port '" + port + "': " + os_msg, -14) {}
89 };
90 
95 public:
96  ReadWriteNotCompleteException(const std::string & errstr, const int error_number) throw ():
97  Exception(errstr, error_number) {}
98 };
99 
104 public:
105  WriteNotCompleteException(const std::string & port) throw ():
106  ReadWriteNotCompleteException("Cannot write all date to '" + port + "'", -15) {}
107 };
108 
113 public:
114  ReadNotCompleteException(const std::string & port) throw ():
115  ReadWriteNotCompleteException("Cannot read all data from '" + port + "'", -16) {}
116 };
117 
121 class ErrorException : public Exception {
122  public:
123  ErrorException(const std::string &error) throw ():
124  Exception(error, -20) {}
125 };
126 
130 
131 #endif
DeviceWriteException(const std::string &port, const std::string os_msg)
PortNotOpenException(const std::string &port)
Exception(const std::string &message, const int error_number)
ReadWriteNotCompleteException(const std::string &errstr, const int error_number)
ErrorException(const std::string &error)
WriteNotCompleteException(const std::string &port)
CannotGetSetPortAttributesException(const std::string &port)
DeviceReadException(const std::string &port, const std::string os_msg)
ReadNotCompleteException(const std::string &port)
int error_number() const
CannotOpenPortException(const std::string &port, const std::string os_msg)


kni
Author(s): Martin Günther
autogenerated on Fri Jan 3 2020 04:01:16