summaryrefslogtreecommitdiff
path: root/gruel/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'gruel/src/include')
-rw-r--r--gruel/src/include/gruel/pmt.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/gruel/src/include/gruel/pmt.h b/gruel/src/include/gruel/pmt.h
index 58533e54e..f904d37e1 100644
--- a/gruel/src/include/gruel/pmt.h
+++ b/gruel/src/include/gruel/pmt.h
@@ -32,6 +32,7 @@
#include <stdint.h>
#include <iosfwd>
#include <stdexcept>
+#include <boost/function.hpp>
namespace gruel {
class msg_accepter;
@@ -805,6 +806,24 @@ 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>