FactoryExceptions.hpp

Go to the documentation of this file.
00001 /***************************************************************************
00002   tag: Peter Soetens  Mon Jan 19 14:11:25 CET 2004  FactoryExceptions.hpp
00003 
00004                         FactoryExceptions.hpp -  description
00005                            -------------------
00006     begin                : Mon January 19 2004
00007     copyright            : (C) 2004 Peter Soetens
00008     email                : peter.soetens@mech.kuleuven.ac.be
00009 
00010  ***************************************************************************
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU General Public                   *
00013  *   License as published by the Free Software Foundation;                 *
00014  *   version 2 of the License.                                             *
00015  *                                                                         *
00016  *   As a special exception, you may use this file as part of a free       *
00017  *   software library without restriction.  Specifically, if other files   *
00018  *   instantiate templates or use macros or inline functions from this     *
00019  *   file, or you compile this file and link it with other files to        *
00020  *   produce an executable, this file does not by itself cause the         *
00021  *   resulting executable to be covered by the GNU General Public          *
00022  *   License.  This exception does not however invalidate any other        *
00023  *   reasons why the executable file might be covered by the GNU General   *
00024  *   Public License.                                                       *
00025  *                                                                         *
00026  *   This library is distributed in the hope that it will be useful,       *
00027  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00028  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00029  *   Lesser General Public License for more details.                       *
00030  *                                                                         *
00031  *   You should have received a copy of the GNU General Public             *
00032  *   License along with this library; if not, write to the Free Software   *
00033  *   Foundation, Inc., 59 Temple Place,                                    *
00034  *   Suite 330, Boston, MA  02111-1307  USA                                *
00035  *                                                                         *
00036  ***************************************************************************/
00037 
00038 #ifndef FACTORYEXCEPTIONS_HPP
00039 #define FACTORYEXCEPTIONS_HPP
00040 
00041 #include <string>
00042 #include <exception>
00043 #include "rtt-config.h"
00044 
00049 namespace RTT
00050 {
00055     struct RTT_EXPORT name_not_found_exception
00056         : public std::exception
00057   {
00058       name_not_found_exception( const std::string& n="name" );
00059       ~name_not_found_exception() throw();
00060       std::string name;
00061       std::string whatstr;
00062       virtual const char* what() const throw();
00063   };
00064 
00069   struct RTT_EXPORT wrong_number_of_args_exception
00070       : public std::exception
00071   {
00072       int wanted;
00073       int received;
00074       std::string whatstr;
00075       wrong_number_of_args_exception( int w, int r );
00076       ~wrong_number_of_args_exception() throw();
00077       virtual const char* what() const throw();
00078   };
00079 
00084   struct RTT_EXPORT wrong_types_of_args_exception
00085       : public std::exception
00086   {
00087       // this contains the number of the argument that had the wrong
00088       // type.  The first argument has number 1.
00089       int whicharg;
00090       std::string expected_;
00091       std::string received_;
00092       std::string whatstr;
00093       wrong_types_of_args_exception( int w, const std::string& expected, const std::string& received );
00094       ~wrong_types_of_args_exception() throw();
00095       virtual const char* what() const throw();
00096   };
00097 
00104   struct RTT_EXPORT non_lvalue_args_exception
00105       : public std::exception
00106   {
00107       // thrown when a factory expects an AssignableDataSource (lvalue), but only
00108       // found a DataSource (rvalue).
00109       int whicharg;
00110       std::string received_;
00111       std::string whatstr;
00112       non_lvalue_args_exception( int w, const std::string& received );
00113       ~non_lvalue_args_exception() throw();
00114       virtual const char* what() const throw();
00115   };
00116 }
00117 
00118 #endif
Generated on Thu Dec 23 13:22:37 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3