summaryrefslogtreecommitdiff
path: root/lib/gras_impl/buffer_queue.hpp
diff options
context:
space:
mode:
authorJosh Blum2012-09-10 02:00:31 -0700
committerJosh Blum2012-09-10 02:00:31 -0700
commit4adb2a384bb06406ffaf3ca4f5a33e42f8a74491 (patch)
tree2e3839e3acc7792f3bb691e864245fdf31dbcac7 /lib/gras_impl/buffer_queue.hpp
parent01a9ef2060e34b7cb6e8863e39854c5a0ae80b58 (diff)
downloadsandhi-4adb2a384bb06406ffaf3ca4f5a33e42f8a74491.tar.gz
sandhi-4adb2a384bb06406ffaf3ca4f5a33e42f8a74491.tar.bz2
sandhi-4adb2a384bb06406ffaf3ca4f5a33e42f8a74491.zip
switch to using sbuffer in gras impl
Diffstat (limited to 'lib/gras_impl/buffer_queue.hpp')
-rw-r--r--lib/gras_impl/buffer_queue.hpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/gras_impl/buffer_queue.hpp b/lib/gras_impl/buffer_queue.hpp
index 5fd1661..306b369 100644
--- a/lib/gras_impl/buffer_queue.hpp
+++ b/lib/gras_impl/buffer_queue.hpp
@@ -17,19 +17,26 @@
#ifndef INCLUDED_LIBGRAS_IMPL_BUFFER_QUEUE_HPP
#define INCLUDED_LIBGRAS_IMPL_BUFFER_QUEUE_HPP
-#include <tsbe/buffer.hpp>
+#include <gnuradio/sbuffer.hpp>
#include <boost/bind.hpp>
#include <queue>
namespace gnuradio
{
-struct BufferQueue : std::queue<tsbe::Buffer>
+struct BufferQueue : std::queue<SBuffer>
{
+ void __push(SBuffer &buffer)
+ {
+ buffer.offset = 0;
+ buffer.length = buffer.get_actual_length();
+ this->push(buffer);
+ }
+
BufferQueue(void)
{
- tsbe::BufferDeleter deleter = boost::bind(&BufferQueue::push, this, _1);
- _token = tsbe::BufferToken(new tsbe::BufferDeleter(deleter));
+ SBufferDeleter deleter = boost::bind(&BufferQueue::__push, this, _1);
+ _token = SBufferToken(new SBufferDeleter(deleter));
}
~BufferQueue(void)
@@ -43,15 +50,15 @@ struct BufferQueue : std::queue<tsbe::Buffer>
void allocate_one(const size_t num_bytes)
{
- tsbe::BufferConfig config;
+ SBufferConfig config;
config.memory = NULL;
config.length = num_bytes;
config.token = _token;
- tsbe::Buffer buff(config);
+ SBuffer buff(config);
//buffer derefs here and the token messages it back to the queue
}
- tsbe::BufferToken _token;
+ SBufferToken _token;
};
} //namespace gnuradio