Storage Engine API
mongo::MmapV1ExtentManager::FilesArray Class Reference

Simple wrapper around an array object to allow append-only modification of the array, as well as concurrent read-accesses. More...

Detailed Description

Simple wrapper around an array object to allow append-only modification of the array, as well as concurrent read-accesses.

This class has a minimal interface to keep implementation simple and easy to modify.

Public Member Functions

 FilesArray ()
 
 ~FilesArray ()
 
void close (OperationContext *opCtx)
 Must be called before destruction. More...
 
DataFileoperator[] (int n) const
 Returns file at location 'n' in the array, with 'n' less than number of files added. More...
 
bool empty () const
 Returns true iff no files were added. More...
 
int size () const
 Returns number of files added to the array. More...
 
void push_back (DataFile *val)
 

Private Attributes

stdx::mutex _writersMutex
 
AtomicInt32 _size
 
DataFile_files [DiskLoc::MaxFiles]
 

Constructor & Destructor Documentation

◆ FilesArray()

mongo::MmapV1ExtentManager::FilesArray::FilesArray ( )
inline

◆ ~FilesArray()

mongo::MmapV1ExtentManager::FilesArray::~FilesArray ( )

Member Function Documentation

◆ close()

void mongo::MmapV1ExtentManager::FilesArray::close ( OperationContext *  opCtx)

Must be called before destruction.

◆ empty()

bool mongo::MmapV1ExtentManager::FilesArray::empty ( ) const
inline

Returns true iff no files were added.

◆ operator[]()

DataFile* mongo::MmapV1ExtentManager::FilesArray::operator[] ( int  n) const
inline

Returns file at location 'n' in the array, with 'n' less than number of files added.

Will always return the same pointer for a given file.

◆ push_back()

void mongo::MmapV1ExtentManager::FilesArray::push_back ( DataFile val)

◆ size()

int mongo::MmapV1ExtentManager::FilesArray::size ( ) const
inline

Returns number of files added to the array.

Member Data Documentation

◆ _files

DataFile* mongo::MmapV1ExtentManager::FilesArray::_files[DiskLoc::MaxFiles]
private

◆ _size

AtomicInt32 mongo::MmapV1ExtentManager::FilesArray::_size
private

◆ _writersMutex

stdx::mutex mongo::MmapV1ExtentManager::FilesArray::_writersMutex
private

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