00001 #ifndef VCDRFGLKVBLFGDGHKJSDFGKJXCHVGKCVF
00002 #define VCDRFGLKVBLFGDGHKJSDFGKJXCHVGKCVF
00003
00005
00020 #include "SctNames.h"
00021
00022 namespace Sct {
00023
00024
00025 template<typename T>
00026 class DestroyingDeleter {
00027 public:
00028 static boost::shared_ptr<T> shared_ptr(T * t) {
00029 return boost::shared_ptr<T>(t, DestroyingDeleter<T>() );
00030 };
00031 public:
00032 void operator() (T * t) throw() {
00033 try {
00034 t->_destroy();
00035 } catch (...) {
00036 try {
00037 MRSStream& msg = SctNames::Mrs();
00038 msg << "DestroyingSharedPtr was trying to _destroy something, but unfortunaltely that _destroy method threw an exception. We are in a method that is not permitted to throw exceptions, so we will now catch it, but THIS IS NOT SUPPOSED TO HAPPEN! DO NOT TRUST further output! (And bear in mind that memory is probably now leaking!)" << ENDM ;
00039 } catch (...) {
00040
00041 };
00042
00043 };
00044 };
00045 };
00046
00047
00048 };
00049
00050 #endif