summaryrefslogtreecommitdiff
path: root/include/leveldb/db.h
diff options
context:
space:
mode:
authordgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-05-21 02:17:43 +0000
committerdgrogan@chromium.org <dgrogan@chromium.org@62dab493-f737-651d-591e-8d6aee1b9529>2011-05-21 02:17:43 +0000
commitda7990950787257cb312ca562ce5977749afc3e9 (patch)
tree91fe98f6e14e74c794392b22105a47a58499edff /include/leveldb/db.h
parent3c111335a760d8d82414b91a54f740df09dd4f8f (diff)
downloadleveldb-da7990950787257cb312ca562ce5977749afc3e9.tar.gz
sync with upstream @ 21409451
Check the NEWS file for details of what changed. git-svn-id: https://leveldb.googlecode.com/svn/trunk@28 62dab493-f737-651d-591e-8d6aee1b9529
Diffstat (limited to 'include/leveldb/db.h')
-rw-r--r--include/leveldb/db.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/leveldb/db.h b/include/leveldb/db.h
index f18ded3..79bd283 100644
--- a/include/leveldb/db.h
+++ b/include/leveldb/db.h
@@ -13,26 +13,32 @@
namespace leveldb {
static const int kMajorVersion = 1;
-static const int kMinorVersion = 1;
+static const int kMinorVersion = 2;
struct Options;
struct ReadOptions;
struct WriteOptions;
-
-class Snapshot;
class WriteBatch;
-// Some internal types. Clients should ignore.
-class WriteBatchInternal;
+// Abstract handle to particular state of a DB.
+// A Snapshot is an immutable object and can therefore be safely
+// accessed from multiple threads without any external synchronization.
+class Snapshot {
+ protected:
+ virtual ~Snapshot();
+};
+// A range of keys
struct Range {
- Slice start;
- Slice limit;
+ Slice start; // Included in the range
+ Slice limit; // Not included in the range
Range(const Slice& s, const Slice& l) : start(s), limit(l) { }
};
// A DB is a persistent ordered map from keys to values.
+// A DB is safe for concurrent access from multiple threads without
+// any external synchronization.
class DB {
public:
// Open the database with the specified "name".