summaryrefslogtreecommitdiff
path: root/ext/librethinkdbxx/src/cursor.h
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2019-03-21 16:42:52 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2019-03-21 16:42:52 -0700
commite37eb0aa542ef8aee8532c5bfdde7f09ed343a28 (patch)
treec2900b4814847fb3249b41e7dcfe5ab6dbac9215 /ext/librethinkdbxx/src/cursor.h
parent130fa35bb1707ea232015c1a3672f0585632dea1 (diff)
downloadinfinitytier-e37eb0aa542ef8aee8532c5bfdde7f09ed343a28.tar.gz
infinitytier-e37eb0aa542ef8aee8532c5bfdde7f09ed343a28.zip
More cleanup of old stuff no longer used.
Diffstat (limited to 'ext/librethinkdbxx/src/cursor.h')
-rw-r--r--ext/librethinkdbxx/src/cursor.h76
1 files changed, 0 insertions, 76 deletions
diff --git a/ext/librethinkdbxx/src/cursor.h b/ext/librethinkdbxx/src/cursor.h
deleted file mode 100644
index 60ae1817..00000000
--- a/ext/librethinkdbxx/src/cursor.h
+++ /dev/null
@@ -1,76 +0,0 @@
-#pragma once
-
-#include "connection.h"
-
-namespace RethinkDB {
-
-// The response from the server, as returned by run.
-// The response is either a single datum or a stream:
-// * If it is a stream, the cursor represents each element of the stream.
-// - Batches are fetched from the server as needed.
-// * If it is a single datum, is_single() returns true.
-// - If it is an array, the cursor represents each element of that array
-// - Otherwise, to_datum() returns the datum and iteration throws an exception.
-// The cursor can only be iterated over once, it discards data that has already been read.
-class CursorPrivate;
-class Cursor {
-public:
- Cursor() = delete;
- ~Cursor();
-
- Cursor(Cursor&&); // movable
- Cursor& operator=(Cursor&&);
- Cursor(const Cursor&) = delete; // not copyable
- Cursor& operator=(const Cursor&) = delete;
-
- // Returned by begin() and end()
- class iterator {
- public:
- iterator(Cursor*);
- iterator& operator++ ();
- Datum& operator* ();
- bool operator!= (const iterator&) const;
-
- private:
- Cursor *cursor;
- };
-
- // Consume the next element
- Datum& next(double wait = FOREVER) const;
-
- // Peek at the next element
- Datum& peek(double wait = FOREVER) const;
-
- // Call f on every element of the Cursor
- void each(std::function<void(Datum&&)> f, double wait = FOREVER) const;
-
- // Consume and return all elements
- Array&& to_array() &&;
-
- // If is_single(), returns the single datum. Otherwise returns to_array().
- Datum to_datum() &&;
- Datum to_datum() const &;
-
- // Efficiently consume and return all elements
- Array to_array() const &;
-
- // Close the cursor
- void close() const;
-
- // Returns false if there are no more elements
- bool has_next(double wait = FOREVER) const;
-
- // Returns false if the cursor is a stream
- bool is_single() const;
-
- iterator begin();
- iterator end();
-
-private:
- explicit Cursor(CursorPrivate *dd);
- std::unique_ptr<CursorPrivate> d;
-
- friend class Connection;
-};
-
-}