From d4bd90853f499d5b65a61b3b7bf9ecf50e68bf6b Mon Sep 17 00:00:00 2001
From: David Sorber <david.sorber@blacklynx.tech>
Date: Mon, 18 Oct 2021 08:54:12 -0400
Subject: runtime: replace the DEFINE_CUSTOM_BUFFER_TYPE() macro function with
 some advanced template magic; also a few minor type corrections for
 consistency

Signed-off-by: David Sorber <david.sorber@blacklynx.tech>
---
 gnuradio-runtime/lib/host_buffer.cc | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

(limited to 'gnuradio-runtime/lib/host_buffer.cc')

diff --git a/gnuradio-runtime/lib/host_buffer.cc b/gnuradio-runtime/lib/host_buffer.cc
index 535a7a5286..eb5d4bd515 100644
--- a/gnuradio-runtime/lib/host_buffer.cc
+++ b/gnuradio-runtime/lib/host_buffer.cc
@@ -14,8 +14,6 @@
 
 namespace gr {
 
-buffer_type host_buffer::type(buftype_HOST_BUFFER{});
-
 void* host_buffer::device_memcpy(void* dest, const void* src, std::size_t count)
 {
     // There is no spoon...er... device so fake it out using regular memcpy
@@ -28,6 +26,22 @@ void* host_buffer::device_memmove(void* dest, const void* src, std::size_t count
     return std::memmove(dest, src, count);
 }
 
+buffer_type host_buffer::type(buftype<host_buffer, host_buffer>{});
+
+buffer_sptr host_buffer::make_buffer(int nitems,
+                                     size_t sizeof_item,
+                                     uint64_t downstream_lcm_nitems,
+                                     uint32_t downstream_max_out_mult,
+                                     block_sptr link,
+                                     block_sptr buf_owner)
+{
+    return buffer_sptr(new host_buffer(nitems,
+                                       sizeof_item,
+                                       downstream_lcm_nitems,
+                                       downstream_max_out_mult,
+                                       link,
+                                       buf_owner));
+}
 
 host_buffer::host_buffer(int nitems,
                          size_t sizeof_item,
-- 
cgit v1.2.3