Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

IllegalSendError.hh

Go to the documentation of this file.
00001 #ifndef ILLEGAL_SEND_ERROR_H
00002 #define ILLEGAL_SEND_ERROR_H
00003 
00023 #include <string>
00024 #include <sstream>
00025 #include <typeinfo>
00026 #include <stdexcept>
00027 
00058 template<typename EvType> 
00059 class EventSender<EvType>::IllegalSendError
00060     : public std::logic_error
00061 {
00062     public:
00064         IllegalSendError() : std::logic_error( msg() ) {}
00065 
00066     private:
00068         static std::string nl() throw()  { return "\n!!! "; }
00069         
00071         static std::string msg()
00072         {
00073             std::ostringstream ss;
00074             ss << nl() << "BUG alert (Recursive send forbidden): "
00075                << nl() << "Method send() of " << typeid(EventSender<EvType>).name()
00076                << nl() << "calls itself indirectly through listeners"
00077                << nl() << "(forbidden since could lead to infinite loop).";
00078             return ss.str();
00079         }
00080 };
00081 
00082 #endif // ILLEGAL_SEND_ERROR_H

Generated on Sun Feb 16 16:56:21 2003 for C++ Event Handling Template Library by doxygen1.2.18