exception.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * $Id: exception.hpp 813 2008-07-25 21:53:52Z mloskot $
00003  *
00004  * Project:  libLAS - http://liblas.org - A BSD library for LAS format data.
00005  * Purpose:  Exception subclasses for C++ libLAS 
00006  * Author:   Mateusz Loskot, mateusz@loskot.net
00007  *
00008  ******************************************************************************
00009  * Copyright (c) 2008, Mateusz Loskot
00010  * Copyright (c) 2008, Howard Butler
00011  *
00012  * All rights reserved.
00013  * 
00014  * Redistribution and use in source and binary forms, with or without 
00015  * modification, are permitted provided that the following 
00016  * conditions are met:
00017  * 
00018  *     * Redistributions of source code must retain the above copyright 
00019  *       notice, this list of conditions and the following disclaimer.
00020  *     * Redistributions in binary form must reproduce the above copyright 
00021  *       notice, this list of conditions and the following disclaimer in 
00022  *       the documentation and/or other materials provided 
00023  *       with the distribution.
00024  *     * Neither the name of the Martin Isenburg or Iowa Department 
00025  *       of Natural Resources nor the names of its contributors may be 
00026  *       used to endorse or promote products derived from this software 
00027  *       without specific prior written permission.
00028  * 
00029  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
00030  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
00031  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
00032  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
00033  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
00034  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
00035  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 
00036  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
00037  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 
00038  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
00039  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
00040  * OF SUCH DAMAGE.
00041  ****************************************************************************/
00042
00043 #ifndef LIBLAS_EXCEPTION_HPP_INCLUDED
00044 #define LIBLAS_EXCEPTION_HPP_INCLUDED
00045 
00046 #include <stdexcept>
00047 #include <string>
00048
00049 namespace liblas {
00050
00053 class invalid_point_data : public std::runtime_error
00054 {
00055 public:
00056
00057     invalid_point_data(std::string const& msg, unsigned int who)
00058         : std::runtime_error(msg), m_who(who)
00059     {}
00060
00064     unsigned int who() const
00065     {
00066         return m_who;
00067     }
00068
00069 private:
00070
00071     unsigned int m_who;
00072 };
00073
00074 } // namespace liblas
00075
00076 #endif // LIBLAS_EXCEPTION_HPP_INCLUDED
00077