libLAS API Reference  1.8.1
exception.hpp
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id$
3  *
4  * Project: libLAS - http://liblas.org - A BSD library for LAS format data.
5  * Purpose: Exception subclasses for C++ libLAS
6  * Author: Mateusz Loskot, mateusz@loskot.net
7  *
8  ******************************************************************************
9  * Copyright (c) 2008, Mateusz Loskot
10  * Copyright (c) 2008, Howard Butler
11  *
12  * All rights reserved.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following
16  * conditions are met:
17  *
18  * * Redistributions of source code must retain the above copyright
19  * notice, this list of conditions and the following disclaimer.
20  * * Redistributions in binary form must reproduce the above copyright
21  * notice, this list of conditions and the following disclaimer in
22  * the documentation and/or other materials provided
23  * with the distribution.
24  * * Neither the name of the Martin Isenburg or Iowa Department
25  * of Natural Resources nor the names of its contributors may be
26  * used to endorse or promote products derived from this software
27  * without specific prior written permission.
28  *
29  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
32  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
33  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
34  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
35  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
36  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
37  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
38  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
39  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
40  * OF SUCH DAMAGE.
41  ****************************************************************************/
42 
43 #ifndef LIBLAS_EXCEPTION_HPP_INCLUDED
44 #define LIBLAS_EXCEPTION_HPP_INCLUDED
45 
46 #include <stdexcept>
47 #include <string>
48 
49 namespace liblas {
50 
53 class invalid_point_data : public std::runtime_error
54 {
55 public:
56 
57  invalid_point_data(std::string const& msg, unsigned int who)
58  : std::runtime_error(msg), m_who(who)
59  {}
60 
64  unsigned int who() const
65  {
66  return m_who;
67  }
68 
69 private:
70 
71  unsigned int m_who;
72 };
73 
74 class liblas_error : public std::runtime_error
75 {
76 public:
77 
78  liblas_error(std::string const& msg)
79  : std::runtime_error(msg)
80  {}
81 };
82 
84 {
85 public:
86 
87  invalid_expression(std::string const& msg)
88  : liblas_error(msg)
89  {}
90 };
91 
93 {
94 public:
95 
96  invalid_format(std::string const& msg)
97  : liblas_error(msg)
98  {}
99 };
100 
101 // use this for attempts to use a feature not compiled in, e.g. laszip or gdal
103 {
104 public:
105  configuration_error(std::string const& msg)
106  : liblas_error(msg)
107  {}
108 };
109 
110 // use this for code still under development
112 {
113 public:
114  not_yet_implemented(std::string const& msg)
115  : liblas_error(msg)
116  {}
117 };
118 
119 } // namespace liblas
120 
121 #endif // LIBLAS_EXCEPTION_HPP_INCLUDED
122 
invalid_format(std::string const &msg)
Definition: exception.hpp:96
invalid_expression(std::string const &msg)
Definition: exception.hpp:87
Definition: exception.hpp:111
Exception reporting invalid point data.
Definition: exception.hpp:53
Definition: exception.hpp:74
unsigned int who() const
Return flags identifying invalid point data members.
Definition: exception.hpp:64
Definition: exception.hpp:83
Namespace grouping all elements of libLAS public interface.
Definition: bounds.hpp:60
not_yet_implemented(std::string const &msg)
Definition: exception.hpp:114
configuration_error(std::string const &msg)
Definition: exception.hpp:105
invalid_point_data(std::string const &msg, unsigned int who)
Definition: exception.hpp:57
Definition: exception.hpp:102
liblas_error(std::string const &msg)
Definition: exception.hpp:78
Definition: exception.hpp:92