29 #ifndef HOKUYO_ERRORS_H__
30 #define HOKUYO_ERRORS_H__
35 typedef unsigned char uint8_t;
36 typedef unsigned int uint32_t;
37 #if defined(HOKUYOAIST_STATIC)
38 #define HOKUYOAIST_EXPORT
39 #elif defined(hokuyoaist_EXPORTS)
40 #define HOKUYOAIST_EXPORT __declspec(dllexport)
42 #define HOKUYOAIST_EXPORT __declspec(dllimport)
46 #define HOKUYOAIST_EXPORT
58 char const*
const cmd);
73 BaseError(
unsigned int desc_code,
char const* error_type);
77 virtual unsigned int desc_code()
const throw()
78 {
return desc_code_; }
80 virtual char const* error_type()
const throw()
81 {
return error_type_; }
83 virtual const char* what() throw();
87 unsigned int desc_code_;
104 : BaseError(desc_code,
"LogicError")
107 : BaseError(desc_code, error_type)
170 unsigned int baud()
const throw()
173 const char* what() throw();
186 : RuntimeError(3,
"CloseError")
254 ArgError(
unsigned int desc_code,
char const* error_type)
358 calculated_(calculated)
362 calculated_(rhs.calculated())
365 virtual int expected()
const throw()
366 {
return expected_; }
368 virtual int calculated()
const throw()
369 {
return calculated_; }
371 const char* what() throw();
386 : ProtocolError(25,
"DataCountError")
411 virtual char const*
const line()
const throw()
414 const char* what() throw();
430 ParseError(
char const*
const line,
char const*
const type);
433 virtual char const*
const line()
const throw()
436 virtual char const*
const type()
const throw()
439 const char* what() throw();
454 : ProtocolError(29,
"MissingFirmSpecError")
468 : ProtocolError(30,
"ResponseError")
470 error_[0] = error[0]; error_[1] = error[1];
471 cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
483 virtual char const*
const error_code()
const throw()
487 virtual char const*
const cmd_code()
const throw()
490 const char* what() throw();
509 : ProtocolError(30,
"Scip1ResponseError"),
510 error_(error), cmd_(cmd)
513 : ProtocolError(rhs), error_(rhs.error_code()),
518 virtual char error_code()
const throw()
522 virtual char cmd_code()
const throw()
525 const char* what() throw();
544 : ProtocolError(31,
"CommandEchoError")
546 cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
547 echo_[0] = echo[0]; echo_[1] = echo[1];
559 virtual char const*
const cmd_code()
const throw()
563 virtual char const*
const cmd_echo()
const throw()
566 const char* what() throw();
584 : ProtocolError(32,
"ParamEchoError")
586 cmd_[0] = cmd[0]; cmd_[1] = cmd[1];
596 virtual char const*
const cmd_code()
const throw()
599 const char* what() throw();
616 : ProtocolError(33,
"InsufficientBytesError"),
617 num_(num), line_length_(line_length)
620 : ProtocolError(rhs), num_(rhs.num()),
621 line_length_(rhs.line_length())
624 virtual int num()
const throw()
627 virtual int line_length()
const throw()
628 {
return line_length_; }
630 const char* what() throw();
649 : ProtocolError(34,
"LineLengthError"),
650 length_(length), expected_(expected)
653 : ProtocolError(rhs), length_(rhs.length()),
654 expected_(rhs.expected())
657 virtual int length()
const throw()
660 virtual int expected()
const throw()
661 {
return expected_; }
663 const char* what() throw();
676 #endif // HOKUYO_ERRORS_H__