gui/auxiliary/iterator/exception.hpp

Go to the documentation of this file.
00001 /* $Id: exception.hpp 52869 2012-02-03 20:18:33Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2011 - 2012 by Mark de Wever <koraq@xs4all.nl>
00004    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
00014 */
00015 
00016 /**
00017  * @file
00018  * Contains the exceptions throw by the @ref gui2::iterator::titerator classes.
00019  */
00020 
00021 #ifndef GUI_WIDGETS_AUXILIARY_ITERATOR_EXCEPTION_HPP_INCLUDED
00022 #define GUI_WIDGETS_AUXILIARY_ITERATOR_EXCEPTION_HPP_INCLUDED
00023 
00024 #include "lua_jailbreak_exception.hpp"
00025 
00026 #include <stdexcept>
00027 #include <string>
00028 
00029 namespace gui2 {
00030 
00031 namespace iterator {
00032 
00033 /**
00034  * Thrown when deferring an invalid iterator.
00035  *
00036  * Invalid means the initial state at_end() == true.
00037  */
00038 class tlogic_error
00039     : public std::logic_error
00040     , public tlua_jailbreak_exception
00041 {
00042 public:
00043     explicit tlogic_error(const std::string& message)
00044         : std::logic_error("GUI2 ITERATOR: " + message)
00045         , tlua_jailbreak_exception()
00046     {
00047     }
00048 
00049 private:
00050 
00051     IMPLEMENT_LUA_JAILBREAK_EXCEPTION(tlogic_error)
00052 };
00053 
00054 /**
00055  * Thrown when moving an invalid iterator.
00056  *
00057  * Invalid means the initial state at_end() == true.
00058  */
00059 class trange_error
00060     : public std::range_error
00061     , public tlua_jailbreak_exception
00062 {
00063 public:
00064     explicit trange_error(const std::string& message)
00065         : std::range_error("GUI2 ITERATOR: " + message)
00066         , tlua_jailbreak_exception()
00067     {
00068     }
00069 
00070 private:
00071 
00072     IMPLEMENT_LUA_JAILBREAK_EXCEPTION(trange_error)
00073 };
00074 
00075 } // namespace iterator
00076 
00077 } // namespace gui2
00078 
00079 #endif
00080 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:02:39 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs