Storage Engine API
mongo::DiskLoc Class Reference

represents a disk location/offset on disk in a database. More...

#include <diskloc.h>

Detailed Description

represents a disk location/offset on disk in a database.

64 bits. it is assumed these will be passed around by value a lot so don't do anything to make them large (such as adding a virtual function)

Public Types

enum  SentinelValues { NullOfs = -1, MaxFiles = 16000, InvalidRepr = -2LL }
 

Public Member Functions

 DiskLoc (int a, int Ofs)
 
 DiskLoc ()
 
bool questionable () const
 
bool isNull () const
 
DiskLoc & Null ()
 
void assertOk () const
 
DiskLoc & setInvalid ()
 
bool isValid () const
 
std::string toString () const
 
BSONObj toBSONObj () const
 
int a () const
 
int & GETOFS ()
 
int getOfs () const
 
void set (int a, int b)
 
void inc (int amt)
 
bool sameFile (DiskLoc b)
 
bool operator== (const DiskLoc &b) const
 
bool operator!= (const DiskLoc &b) const
 
int compare (const DiskLoc &b) const
 
RecordId toRecordId () const
 

Static Public Member Functions

static DiskLoc min ()
 
static DiskLoc max ()
 
static DiskLoc fromRecordId (RecordId id)
 

Private Attributes

int _a
 
int ofs
 

Member Enumeration Documentation

◆ SentinelValues

Enumerator
NullOfs 
MaxFiles 
InvalidRepr 

Constructor & Destructor Documentation

◆ DiskLoc() [1/2]

mongo::DiskLoc::DiskLoc ( int  a,
int  Ofs 
)
inline

◆ DiskLoc() [2/2]

mongo::DiskLoc::DiskLoc ( )
inline

Member Function Documentation

◆ a()

int mongo::DiskLoc::a ( ) const
inline

◆ assertOk()

void mongo::DiskLoc::assertOk ( ) const
inline

◆ compare()

int mongo::DiskLoc::compare ( const DiskLoc &  b) const
inline

◆ fromRecordId()

static DiskLoc mongo::DiskLoc::fromRecordId ( RecordId  id)
inlinestatic

◆ GETOFS()

int& mongo::DiskLoc::GETOFS ( )
inline

◆ getOfs()

int mongo::DiskLoc::getOfs ( ) const
inline

◆ inc()

void mongo::DiskLoc::inc ( int  amt)
inline

◆ isNull()

bool mongo::DiskLoc::isNull ( ) const
inline

◆ isValid()

bool mongo::DiskLoc::isValid ( ) const
inline

◆ max()

static DiskLoc mongo::DiskLoc::max ( )
inlinestatic

◆ min()

static DiskLoc mongo::DiskLoc::min ( )
inlinestatic

◆ Null()

DiskLoc& mongo::DiskLoc::Null ( )
inline

◆ operator!=()

bool mongo::DiskLoc::operator!= ( const DiskLoc &  b) const
inline

◆ operator==()

bool mongo::DiskLoc::operator== ( const DiskLoc &  b) const
inline

◆ questionable()

bool mongo::DiskLoc::questionable ( ) const
inline

◆ sameFile()

bool mongo::DiskLoc::sameFile ( DiskLoc  b)
inline

◆ set()

void mongo::DiskLoc::set ( int  a,
int  b 
)
inline

◆ setInvalid()

DiskLoc& mongo::DiskLoc::setInvalid ( )
inline

◆ toBSONObj()

BSONObj mongo::DiskLoc::toBSONObj ( ) const
inline

◆ toRecordId()

RecordId mongo::DiskLoc::toRecordId ( ) const
inline

◆ toString()

std::string mongo::DiskLoc::toString ( ) const
inline

Member Data Documentation

◆ _a

int mongo::DiskLoc::_a
private

◆ ofs

int mongo::DiskLoc::ofs
private

The documentation for this class was generated from the following file: