KatanaNativeInterface
$VERSION$
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
include
KNI
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,
22
ERR_INVALID_ARGUMENT
= -2,
23
ERR_STATE_MISMATCH
= -3,
24
ERR_TYPE_MISMATCH
= -4,
25
ERR_RANGE_MISMATCH
= -5,
26
ERR_AXIS_HEARTBEAT
= -6,
27
ERR_AXIS_OPERATIONAL
= -7,
28
ERR_AXIS_MOVE
= -8,
29
ERR_AXIS_MOVE_POLY
= -9,
30
ERR_AXIS_COLLISION
= -10,
31
ERR_AXIS_ANY
= -11,
32
ERR_CRC
= -12,
33
ERR_PERIPHERAL
= -13,
34
ERR_MESSAGE
= 192,
35
ERR_MESSAGE_STRING
= 193
36
};
37
42
47
class
CannotOpenPortException
:
public
Exception
{
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
56
class
CannotGetSetPortAttributesException
:
public
Exception
{
57
public
:
58
CannotGetSetPortAttributesException
(
const
std::string & port)
throw
():
59
Exception
(
"Cannot get/set attributes on '"
+ port +
"'"
, -11) {}
60
};
61
65
class
PortNotOpenException
:
public
Exception
{
66
public
:
67
PortNotOpenException
(
const
std::string & port)
throw
():
68
Exception
(
"Port '"
+ port +
"' not open"
, -12) {}
69
};
70
75
class
DeviceReadException
:
public
Exception
{
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
85
class
DeviceWriteException
:
public
Exception
{
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
94
class
ReadWriteNotCompleteException
:
public
Exception
{
95
public
:
96
ReadWriteNotCompleteException
(
const
std::string & errstr,
const
int
error_number
)
throw
():
97
Exception
(errstr,
error_number
) {}
98
};
99
103
class
WriteNotCompleteException
:
public
ReadWriteNotCompleteException
{
104
public
:
105
WriteNotCompleteException
(
const
std::string & port)
throw
():
106
ReadWriteNotCompleteException
(
"Cannot write all date to '"
+ port +
"'"
, -15) {}
107
};
108
112
class
ReadNotCompleteException
:
public
ReadWriteNotCompleteException
{
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
Generated by
1.8.1.1