Storage Engine API
mongo::PointerToDurableMappedFile Class Reference

for durability support we want to be able to map pointers to specific DurableMappedFile objects. More...

#include <durable_mapped_file.h>

Detailed Description

for durability support we want to be able to map pointers to specific DurableMappedFile objects.

Public Member Functions

 PointerToDurableMappedFile ()
 
void add_inlock (void *view, DurableMappedFile *f)
 register view. More...
 
void remove (void *view, size_t length)
 de-register view. More...
 
DurableMappedFilefind (void *p, size_t &ofs)
 find associated MMF object for a given pointer. More...
 
stdx::mutex & _mutex ()
 for doing many finds in a row with one lock operation More...
 
DurableMappedFilefind_inlock (void *p, size_t &ofs)
 not-threadsafe, caller must hold _mutex() More...
 
unsigned numberOfViews_inlock () const
 not-threadsafe, caller must hold _mutex() More...
 
void makeWritable (void *, unsigned len)
 make the private map range writable (necessary for our windows implementation) More...
 
void clearWritableBits (void *privateView, size_t len)
 

Private Member Functions

 MONGO_DISALLOW_COPYING (PointerToDurableMappedFile)
 
void clearWritableBits_inlock (void *privateView, size_t len)
 

Private Attributes

stdx::mutex _m
 
std::map< void *, DurableMappedFile * > _views
 

Constructor & Destructor Documentation

◆ PointerToDurableMappedFile()

mongo::PointerToDurableMappedFile::PointerToDurableMappedFile ( )

Member Function Documentation

◆ _mutex()

stdx::mutex& mongo::PointerToDurableMappedFile::_mutex ( )
inline

for doing many finds in a row with one lock operation

◆ add_inlock()

void mongo::PointerToDurableMappedFile::add_inlock ( void view,
DurableMappedFile f 
)

register view.

not-threadsafe, caller must hold _mutex()

threadsafe

◆ clearWritableBits()

void mongo::PointerToDurableMappedFile::clearWritableBits ( void privateView,
size_t  len 
)

◆ clearWritableBits_inlock()

void mongo::PointerToDurableMappedFile::clearWritableBits_inlock ( void privateView,
size_t  len 
)
private

◆ find()

DurableMappedFile * mongo::PointerToDurableMappedFile::find ( void p,
size_t &  ofs 
)

find associated MMF object for a given pointer.

threadsafe

Parameters
ofsout returns offset into the view of the pointer, if found.
Returns
the DurableMappedFile to which this pointer belongs. null if not found.

◆ find_inlock()

DurableMappedFile * mongo::PointerToDurableMappedFile::find_inlock ( void p,
size_t &  ofs 
)

not-threadsafe, caller must hold _mutex()

underscore version of find is for when you are already locked

Parameters
ofsout return our offset in the view
Returns
the DurableMappedFile to which this pointer belongs

◆ makeWritable()

void mongo::PointerToDurableMappedFile::makeWritable ( void _p,
unsigned  len 
)
inline

make the private map range writable (necessary for our windows implementation)

◆ MONGO_DISALLOW_COPYING()

mongo::PointerToDurableMappedFile::MONGO_DISALLOW_COPYING ( PointerToDurableMappedFile  )
private

◆ numberOfViews_inlock()

unsigned mongo::PointerToDurableMappedFile::numberOfViews_inlock ( ) const
inline

not-threadsafe, caller must hold _mutex()

◆ remove()

void mongo::PointerToDurableMappedFile::remove ( void view,
size_t  len 
)

de-register view.

threadsafe

Member Data Documentation

◆ _m

stdx::mutex mongo::PointerToDurableMappedFile::_m
private

◆ _views

std::map<void*, DurableMappedFile*> mongo::PointerToDurableMappedFile::_views
private

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