diff options
author | Dwight <dmerriman@gmail.com> | 2007-10-30 11:35:17 -0400 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2007-10-30 11:35:17 -0400 |
commit | fc316ba2be028181eb745f3a0effe9988a55b588 (patch) | |
tree | 19e48e6cb46ec10d31724f7e453aeef9d2a7f938 /db/storage.h | |
parent | 1e7d144631b797be819dd3006bdff1c32afbbc45 (diff) | |
download | mongo-fc316ba2be028181eb745f3a0effe9988a55b588.tar.gz |
update, delete
Diffstat (limited to 'db/storage.h')
-rw-r--r-- | db/storage.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/db/storage.h b/db/storage.h index 4978ec79a0d..2a22a0098ee 100644 --- a/db/storage.h +++ b/db/storage.h @@ -9,21 +9,27 @@ #pragma pack(push)
#pragma pack(1)
+class Record;
+class DeletedRecord;
+class Extent;
+
class DiskLoc {
int reserved; /* this will be volume, file #, etc. */
int ofs;
public:
+ enum { NullOfs = -1 };
int a() const { return reserved; }
DiskLoc(int a, int b) : reserved(a), ofs(b) { }
- DiskLoc() { reserved = -1; ofs = -1; }
+ DiskLoc() { reserved = -1; ofs = NullOfs; }
- bool isNull() { return ofs == -1; }
- void Null() { reserved = -1; ofs = -1; }
+ bool isNull() { return ofs == NullOfs; }
+ void Null() { reserved = -1; ofs = NullOfs; }
void assertOk() { assert(!isNull()); }
int getOfs() const { return ofs; }
+ void set(int a, int b) { reserved=a; ofs=b; }
void setOfs(int _ofs) {
- reserved = -2;
+ reserved = -2; /*temp: fix for multiple datafiles */
ofs = _ofs;
}
@@ -35,6 +41,10 @@ public: bool sameFile(DiskLoc b) { return reserved == b.reserved; /* not really done...*/ }
bool operator==(const DiskLoc& b) { return reserved==b.reserved && ofs == b.ofs; }
+
+ Record* rec() const;
+ DeletedRecord* drec() const;
+ Extent* ext() const;
};
#pragma pack(pop)
|