MrSID Decode SDK for LiDAR Reference Manual 1.1.4.4709

- Main Page
- Classes
- Files

- File List
- File Members

Error.h
Go to the documentation of this file.
1 /* //////////////////////////////////////////////////////////////////////////
2 // //
3 // This code is Copyright (c) 2008-2010 LizardTech, Inc, 1008 Western //
4 // Avenue, Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
5 // prohibited. Access to and use of this code is permitted only under //
6 // license from LizardTech, Inc. Portions of the code are protected by //
7 // US and foreign patents and other filings. All Rights Reserved. //
8 // //
10 /* PUBLIC */
11
12 #ifndef __LIDAR_ERROR_H__
13 #define __LIDAR_ERROR_H__
14
15 #include "lidar/Base.h"
16 #include <exception>
17
18 LT_BEGIN_LIDAR_NAMESPACE
19
21 #define THROW_LIBRARY_ERROR(code) \
22 throw Error(__FILE__, __FUNCTION__, __LINE__, code)
23
25 #define THROW_OS_ERROR() \
26 throw OSError(__FILE__, __FUNCTION__, __LINE__)
27
31 class Error : public std::exception
32 {
33 public:
34 ~Error(void) throw();
35 Error(const Error &copy) throw();
36
46 Error(const char *file, const char *func, int line, int code) throw();
47
53 const char *filename(void) const throw();
59 const char *function(void) const throw();
65 int line(void) const throw();
71 int error(void) const throw();
72
78 const char *what(void) const throw();
79
87 Error &operator()(const char *fmt, ...) throw();
88
89 protected:
90 enum { BUFFERSIZE = 1024 };
91 char m_desc[BUFFERSIZE];
92 const char *m_file;
93 const char *m_func;
94 int m_line;
95 int m_error;
96 };
97
102 class OSError : public Error
103 {
104 public:
116 OSError(const char *file, const char *func, int line) throw();
117 };
118
119 LT_END_LIDAR_NAMESPACE
120 #endif // __LIDAR_ERROR_H__

LizardTech