Commit 6aa58198 authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #1845 from claudioscordino/master

Better comments for understanding the classes array_t<> and array_ite…
parents 8a0a18a5 cb1b6bc9
......@@ -35,9 +35,16 @@
namespace zmq
{
// Implementation of fast arrays with O(1) access, insertion and
// removal. The array stores pointers rather than objects.
// O(1) is achieved by making items inheriting from
// array_item_t<ID> class which internally stores the position
// in the array.
// The ID template argument is used to differentiate among arrays
// and thus let an object be stored in different arrays.
// Base class for objects stored in the array. If you want to store
// same object in mutliple arrays, each of those arrays has to have
// same object in multiple arrays, each of those arrays has to have
// different ID. The item itself has to be derived from instantiations of
// array_item_t template for all relevant IDs.
......@@ -74,9 +81,6 @@ namespace zmq
const array_item_t &operator = (const array_item_t&);
};
// Fast array implementation with O(1) access to item, insertion and
// removal. Array stores pointers rather than objects. The objects have
// to be derived from array_item_t<ID> class.
template <typename T, int ID = 0> class array_t
{
......
......@@ -67,7 +67,7 @@ namespace zmq
// Note that pipe can be stored in three different arrays.
// The array of inbound pipes (1), the array of outbound pipes (2) and
// the generic array of pipes to deallocate (3).
// the generic array of pipes to be deallocated (3).
class pipe_t :
public object_t,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment