Main Page | Class Hierarchy | Class List | File List | Class Members

/home/nutarojj/Desktop/adevs/include/adevs_exception.h

00001 /***************
00002 Copyright (C) 2000-2006 by James Nutaro
00003 
00004 This library is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU Lesser General Public
00006 License as published by the Free Software Foundation; either
00007 version 2 of the License, or (at your option) any later version.
00008 
00009 This library is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 Lesser General Public License for more details.
00013 
00014 You should have received a copy of the GNU Lesser General Public
00015 License along with this library; if not, write to the Free Software
00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 
00018 Bugs, comments, and questions can be sent to nutaro@gmail.com
00019 ***************/
00020 
00021 #ifndef _adevs_exception_h_
00022 #define _adevs_exception_h_
00023 #include <string>
00024 #include <exception>
00025 
00026 namespace adevs
00027 {
00028 
00033 class exception: public std::exception
00034 {
00035         public:
00041                 exception(const char* msg, void* model = NULL):
00042                 std::exception(),
00043                 msg(msg),
00044                 model(model) 
00045                 {}
00049                 exception(const adevs::exception& src):
00050                 std::exception(src),
00051                 msg(src.msg),
00052                 model(src.model)
00053                 {}
00057                 const char* what() const throw()
00058                 {
00059                         return msg.c_str();
00060                 }
00064                 void* who() const { return model; }
00068                 ~exception() throw(){}
00069         private:
00070                 std::string msg;
00071                 void* model;
00072 };
00073 
00074 } // end of namespace
00075 
00076 #endif
00077 

Generated on Mon Jun 1 09:53:42 2009 for adevs by  doxygen 1.3.9.1