2
* libpal - Automated Placement of Labels Library
4
* Copyright (C) 2008 Maxence Laurent, MIS-TIC, HEIG-VD
5
* University of Applied Sciences, Western Switzerland
9
* maxence.laurent <at> heig-vd <dot> ch
11
* eric.taillard <at> heig-vd <dot> ch
13
* This file is part of libpal.
15
* libpal is free software: you can redistribute it and/or modify
16
* it under the terms of the GNU General Public License as published by
17
* the Free Software Foundation, either version 3 of the License, or
18
* (at your option) any later version.
20
* libpal is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
* GNU General Public License for more details.
25
* You should have received a copy of the GNU General Public License
26
* along with libpal. If not, see <http://www.gnu.org/licenses/>.
34
#ifndef PAL_EXCEPTION_H
35
#define PAL_EXCEPTION_H
43
/** \brief Various Exceptions
49
/** \brief Thrown when a feature is not yet implemented
51
class NotImplemented : public std::exception
53
const char * what() const throw()
55
return "Not yet implemented... sorry";
59
/** \brief Try to access an unknown feature
61
class UnknownFeature : public std::exception
63
const char * what() const throw()
65
return "Feature not found";
69
/** \brief Try to access an unknown layer
71
class UnknownLayer : public std::exception
73
const char * what() const throw()
75
return "Layer not found";
79
/** \brief layer already exists
81
class LayerExists : public std::exception
83
const char * what() const throw()
85
return "Layers names must be unique";
89
/** \brief features already exists
91
class FeatureExists : public std::exception
93
const char * what() const throw()
95
return "Features IDs must be unique within a layer";
99
/** \brief thrown when a value is not in the valid scale range
101
* It can be thrown by :
103
* - pal::Layer::setFeatureLabelSize if either the height or the width of the label is < 0
105
* - pal::Layer::setFeatureDistlabel is distlable < 0
107
class ValueNotInRange : public std::exception
109
const char * what() const throw()
111
return "value not allowed";