From cb1b6bc9aeb3246210311289927e7345385abd28 Mon Sep 17 00:00:00 2001 From: Claudio Scordino Date: Tue, 8 Mar 2016 11:24:58 +0100 Subject: [PATCH] Better comments for understanding the classes array_t<> and array_item_t<> --- src/array.hpp | 12 ++++++++---- src/pipe.hpp | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/array.hpp b/src/array.hpp index 27ef5514..fe903ffd 100644 --- a/src/array.hpp +++ b/src/array.hpp @@ -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 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 class. template class array_t { diff --git a/src/pipe.hpp b/src/pipe.hpp index 510a69bf..ae17cc93 100644 --- a/src/pipe.hpp +++ b/src/pipe.hpp @@ -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,