summaryrefslogtreecommitdiffstats
path: root/include/util/Cursor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/util/Cursor.h')
-rw-r--r--include/util/Cursor.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/include/util/Cursor.h b/include/util/Cursor.h
index be7ab32..e8ba53d 100644
--- a/include/util/Cursor.h
+++ b/include/util/Cursor.h
@@ -7,15 +7,18 @@
* Distributed under the Modified BSD License.
*
* A simple record cursor type with associated methods for help in
- * merging record sets when constructing shards.
+ * merging record sets when constructing shards. Iterates an array
+ * of records in order, and provides facilities to make sorted merges
+ * easier.
+ *
+ * TODO: Prior versions of this module included automatic support for
+ * working with data stored in PagedFiles as well. That should be
+ * reintroduced at some point.
*/
#pragma once
-#include "framework/ShardRequirements.h"
-
-#include "psu-ds/BloomFilter.h"
-#include "psu-ds/PriorityQueue.h"
-#include "psu-util/alignment.h"
+#include <cstdlib>
+#include <vector>
namespace de {
template<typename R>
@@ -64,6 +67,8 @@ template <typename R>
inline static Cursor<R> *get_next(std::vector<Cursor<R>> &cursors, Cursor<R> *current=nullptr) {
const R *min_rec = nullptr;
Cursor<R> *result = nullptr;
+ // FIXME: for large cursor vectors, it may be worth it to use a
+ // PriorityQueue here instead of scanning.
for (size_t i=0; i< cursors.size(); i++) {
if (cursors[i] == (Cursor<R>) {0} ) continue;