37 #include <boost/functional/hash.hpp> 40 #include "mongo/db/jsobj.h" 41 #include "mongo/db/record_id.h" 45 template <
class Version>
90 return DiskLoc(0x7fffffff, 0x7ffffffe);
94 return ofs < -1 || _a < -1 || _a > 524288;
122 std::stringstream ss;
123 ss << _a <<
':' << std::hex <<
ofs;
128 return BSON(
"file" << _a <<
"offset" << ofs);
141 void set(
int a,
int b) {
156 return _a == b.
_a && ofs == b.
ofs;
159 return !(*
this == b);
170 return DiskLoc((
id.repr() >> 32), uint32_t(
id.repr()));
175 if (
id == RecordId::max())
178 if (
id == RecordId::min())
188 return RecordId::min();
191 return RecordId::max();
193 return RecordId(uint64_t(_a) << 32 | uint32_t(ofs));
bool operator<(const KeyString &lhs, const KeyString &rhs)
Definition: key_string.h:426
bool operator!=(const DiskLoc &b) const
Definition: diskloc.h:158
void inc(int amt)
Definition: diskloc.h:146
int _a
Definition: diskloc.h:56
bool questionable() const
Definition: diskloc.h:93
void assertOk() const
Definition: diskloc.h:107
bool isNull() const
Definition: diskloc.h:97
DiskLoc & setInvalid()
Definition: diskloc.h:110
int compare(const DiskLoc &b) const
Definition: diskloc.h:161
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
int & GETOFS()
Definition: diskloc.h:135
static DiskLoc max()
Definition: diskloc.h:89
represents a disk location/offset on disk in a database.
Definition: diskloc.h:53
RecordId toRecordId() const
Definition: diskloc.h:185
bool sameFile(DiskLoc b)
Definition: diskloc.h:151
bool operator>=(const KeyString &lhs, const KeyString &rhs)
Definition: key_string.h:442
int ofs
Definition: diskloc.h:57
static DiskLoc fromRecordId(RecordId id)
Definition: diskloc.h:168
static DiskLoc min()
Definition: diskloc.h:81
std::string toString() const
Definition: diskloc.h:119
std::ostream & operator<<(std::ostream &stream, const IndexKeyEntry &entry)
Definition: index_entry_comparison.cpp:37
bool operator==(const DiskLoc &b) const
Definition: diskloc.h:155
bool operator>(const KeyString &lhs, const KeyString &rhs)
Definition: key_string.h:438
bool isValid() const
Definition: diskloc.h:115
DiskLoc()
Definition: diskloc.h:75
DiskLoc & Null()
Definition: diskloc.h:100
bool operator<=(const KeyString &lhs, const KeyString &rhs)
Definition: key_string.h:430
DiskLoc(int a, int Ofs)
Definition: diskloc.h:74
BSONObj toBSONObj() const
Definition: diskloc.h:127
SentinelValues
Definition: diskloc.h:60
int a() const
Definition: diskloc.h:131
int getOfs() const
Definition: diskloc.h:138