diff options
Diffstat (limited to 'gruel/src')
-rw-r--r-- | gruel/src/include/gruel/pmt.h | 19 | ||||
-rw-r--r-- | gruel/src/lib/pmt/pmt.cc | 14 | ||||
-rw-r--r-- | gruel/src/lib/pmt/pmt_int.h | 9 |
3 files changed, 2 insertions, 40 deletions
diff --git a/gruel/src/include/gruel/pmt.h b/gruel/src/include/gruel/pmt.h index f904d37e1..58533e54e 100644 --- a/gruel/src/include/gruel/pmt.h +++ b/gruel/src/include/gruel/pmt.h @@ -32,7 +32,6 @@ #include <stdint.h> #include <iosfwd> #include <stdexcept> -#include <boost/function.hpp> namespace gruel { class msg_accepter; @@ -806,24 +805,6 @@ GRUEL_API std::string pmt_serialize_str(pmt_t obj); */ GRUEL_API pmt_t pmt_deserialize_str(std::string str); -/* - * ------------------------------------------------------------------------ - * advanced - * ------------------------------------------------------------------------ - */ - -#define GRUEL_PMT_HAVE_PMT_SET_DELETER - -/*! - * Set a deleter function to be called when the PMT dereferences. - * User beware! This function is for extremely advanced use. - * Use boost bind to bind extra parameters into the deleter function. - * Set an empty function type to reset the PMT to the default deleter. - * \param obj the pmt object in which to set the deleter function - * \param deleter a function that gets an opaque PMT pointer type - */ -GRUEL_API void pmt_set_deleter(pmt_t obj, boost::function<void(pmt_base *)> &deleter); - } /* namespace pmt */ #include <gruel/pmt_sugar.h> diff --git a/gruel/src/lib/pmt/pmt.cc b/gruel/src/lib/pmt/pmt.cc index 57b66b1a4..f9cf6b4bf 100644 --- a/gruel/src/lib/pmt/pmt.cc +++ b/gruel/src/lib/pmt/pmt.cc @@ -58,7 +58,7 @@ pmt_base::operator delete(void *p, size_t size) #endif void intrusive_ptr_add_ref(pmt_base* p) { ++(p->count_); } -void intrusive_ptr_release(pmt_base* p) { if (--(p->count_) == 0 ) p->deleter_(p); } +void intrusive_ptr_release(pmt_base* p) { if (--(p->count_) == 0 ) delete p; } pmt_base::~pmt_base() { @@ -1383,16 +1383,4 @@ pmt_dump_sizeof() printf("sizeof(pmt_uniform_vector) = %3zd\n", sizeof(pmt_uniform_vector)); } -/* - * ------------------------------------------------------------------------ - * advanced - * ------------------------------------------------------------------------ - */ - -void -pmt_set_deleter(pmt_t obj, boost::function<void(pmt_base *)> &deleter) -{ - obj->deleter_ = (deleter)? deleter : &pmt_base::default_deleter; -} - } /* namespace pmt */ diff --git a/gruel/src/lib/pmt/pmt_int.h b/gruel/src/lib/pmt/pmt_int.h index 745dbc666..3a5cd382b 100644 --- a/gruel/src/lib/pmt/pmt_int.h +++ b/gruel/src/lib/pmt/pmt_int.h @@ -38,15 +38,8 @@ namespace pmt { class GRUEL_API pmt_base : boost::noncopyable { mutable boost::detail::atomic_count count_; -public: - static void default_deleter(pmt_base *p){ - delete p; - } - - boost::function<void(pmt_base *)> deleter_; - protected: - pmt_base() : count_(0), deleter_(&pmt::pmt_base::default_deleter) {}; + pmt_base() : count_(0) {}; virtual ~pmt_base(); public: |