summaryrefslogtreecommitdiff
path: root/include/gras
diff options
context:
space:
mode:
authorJosh Blum2012-12-16 11:41:26 -0800
committerJosh Blum2012-12-16 11:41:26 -0800
commit540c2343a44b823c0060ab9ab1bdc4d55f01e66d (patch)
tree9f185ef9ec32ada678a878a895f5a6588936af7e /include/gras
parent0865d999f90755cf624f1b4798d74c0376048989 (diff)
downloadsandhi-540c2343a44b823c0060ab9ab1bdc4d55f01e66d.tar.gz
sandhi-540c2343a44b823c0060ab9ab1bdc4d55f01e66d.tar.bz2
sandhi-540c2343a44b823c0060ab9ab1bdc4d55f01e66d.zip
work ont he circ buffer impl
Diffstat (limited to 'include/gras')
-rw-r--r--include/gras/buffer_queue.hpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/include/gras/buffer_queue.hpp b/include/gras/buffer_queue.hpp
index 5125555..da8de41 100644
--- a/include/gras/buffer_queue.hpp
+++ b/include/gras/buffer_queue.hpp
@@ -18,11 +18,41 @@ typedef boost::shared_ptr<BufferQueue> BufferQueueSptr;
struct BufferQueue
{
- //! Create a buffer queue using the pool allocator
- GRAS_API static BufferQueueSptr make_pool(const SBufferConfig &config, const size_t num_buffs);
+ /*!
+ * Create a buffer queue object using the pool allocator.
+ * A pool of buffers contains individual buffer allocations.
+ *
+ * The config param is used to pass information
+ * about per-buffer size, affinity, and token.
+ *
+ * \param config used to alloc one buffer
+ * \param num_buffs alloc this many buffs
+ * \return a new buffer queue sptr
+ */
+ GRAS_API static BufferQueueSptr make_pool(
+ const SBufferConfig &config,
+ const size_t num_buffs
+ );
- //! Create a buffer queue using the circular buffer allocator
- GRAS_API static BufferQueueSptr make_circ(const SBufferConfig &config);
+ /*!
+ * Create a buffer queue object using the circular allocator.
+ * The circular allocator contains one large double-mapped buffer.
+ * This buffer is virtually mapped so that buff[n+len] = buff[n].
+ *
+ * Pieces of this buffer can be passed around in smaller chunks.
+ * The number of chunks is dictated by num_buffs,
+ * the size of the chunks is dictated by config.length.
+ * The size of the circular buffer will be num_buffs*config.length
+ *
+ * \param config used to alloc one buffer
+ * \param num_buffs this many smaller chunks
+ *
+ * \return a new buffer queue sptr
+ */
+ GRAS_API static BufferQueueSptr make_circ(
+ const SBufferConfig &config,
+ const size_t num_buffs
+ );
//! Get a reference to the buffer at the front of the queue
virtual SBuffer &front(void) = 0;