00001 /* 00002 mesh3d 00003 Copyright (C) 2010 Timo Suoranta 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00027 #ifndef MESH3D__EXCEPTION__H 00028 #define MESH3D__EXCEPTION__H 00029 00030 #include "mesh3d/types.h" 00031 00032 namespace mesh3d { 00033 00034 struct attribute_map_not_found_exception 00035 { 00036 attribute_map_not_found_exception(std::string const &name) 00037 { 00038 this->name = name; 00039 } 00040 std::string name; 00041 }; 00042 00043 struct incompatible_attribute_type_exception 00044 { 00045 incompatible_attribute_type_exception( 00046 std::string name, 00047 std::string type_name, 00048 std::string expected_type_name 00049 ) 00050 { 00051 this->name = name; 00052 this->type_name = type_name; 00053 this->expected_type_name = expected_type_name; 00054 } 00055 std::string name; 00056 std::string type_name; 00057 std::string expected_type_name; 00058 }; 00059 00060 struct invalid_index_exception 00061 { 00062 invalid_index_exception(uint32 index, uint32 max_index) 00063 { 00064 this->index = index; 00065 this->max_index = max_index; 00066 } 00067 uint32 index; 00068 uint32 max_index; 00069 }; 00070 00071 template<typename Key> 00072 struct key_not_found_exception 00073 { 00074 key_not_found_exception(Key key) 00075 { 00076 this->key = key; 00077 } 00078 Key key; 00079 }; 00080 00081 } 00082 00083 #endif 00084