Merged features/inband -r4812:5218 into trunk. This group of changes
[debian/gnuradio] / mblock / src / lib / mb_message.h
index 95440f8b74aa2481029e8a2b7882172d485a48b7..6132866e2d5fa32ff5a717bb7a953644fd940223 100644 (file)
@@ -22,6 +22,9 @@
 #define INCLUDED_MB_MESSAGE_H
 
 #include <mb_common.h>
+#include <iosfwd>
+
+#define MB_MESSAGE_LOCAL_ALLOCATOR 0   // define to 0 or 1
 
 class mb_message;
 typedef boost::shared_ptr<mb_message> mb_message_sptr;
@@ -66,6 +69,20 @@ public:
   pmt_t port_id() const { return d_port_id; }
 
   void set_port_id(pmt_t port_id){ d_port_id = port_id; }
+
+#if (MB_MESSAGE_LOCAL_ALLOCATOR)
+  void *operator new(size_t);
+  void operator delete(void *, size_t);
+#endif
 };
 
+std::ostream& operator<<(std::ostream& os, const mb_message &msg);
+
+inline
+std::ostream& operator<<(std::ostream& os, const mb_message_sptr msg)
+{
+  os << *(msg.get());
+  return os;
+}
+
 #endif /* INCLUDED_MB_MESSAGE_H */