[Assorted-commits] SF.net SVN: assorted:[1210] cpp-commons/trunk/src/commons
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-02-20 19:37:42
|
Revision: 1210 http://assorted.svn.sourceforge.net/assorted/?rev=1210&view=rev Author: yangzhang Date: 2009-02-20 19:37:33 +0000 (Fri, 20 Feb 2009) Log Message: ----------- added exceptions; fixed delegates.h inclusion guard Modified Paths: -------------- cpp-commons/trunk/src/commons/boost/delegates.h Added Paths: ----------- cpp-commons/trunk/src/commons/exceptions.h Modified: cpp-commons/trunk/src/commons/boost/delegates.h =================================================================== --- cpp-commons/trunk/src/commons/boost/delegates.h 2009-02-20 19:04:02 UTC (rev 1209) +++ cpp-commons/trunk/src/commons/boost/delegates.h 2009-02-20 19:37:33 UTC (rev 1210) @@ -1,5 +1,5 @@ -#ifndef COMMONS_DELEGATES_H -#define COMMONS_DELEGATES_H +#ifndef COMMONS_BOOST_DELEGATES_H +#define COMMONS_BOOST_DELEGATES_H #include <boost/function.hpp> #include <boost/scoped_ptr.hpp> Added: cpp-commons/trunk/src/commons/exceptions.h =================================================================== --- cpp-commons/trunk/src/commons/exceptions.h (rev 0) +++ cpp-commons/trunk/src/commons/exceptions.h 2009-02-20 19:37:33 UTC (rev 1210) @@ -0,0 +1,25 @@ +#ifndef COMMONS_EXCEPTIONS_H +#define COMMONS_EXCEPTIONS_H + +#include <exception> + +namespace commons +{ + + using namespace std; + + class operation_not_supported : public std::exception + { + public: + operation_not_supported(const string &op) : msg("operation not supported: " + op) {} + ~operation_not_supported() throw() {} + const char *what() const throw() { return msg.c_str(); } + private: + const string msg; + }; + +#define throw_operation_not_supported() throw operation_not_supported(__PRETTY_FUNCTION__) + +} + +#endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |