Storage Engine API
mongo::RecordData Class Reference

A replacement for the Record class. More...

#include <record_data.h>

Detailed Description

A replacement for the Record class.

This class represents data in a record store. The _ownedData attribute is used to manage memory ownership.

Public Member Functions

 RecordData ()
 
 RecordData (const char *data, int size)
 
 RecordData (SharedBuffer ownedData, int size)
 
const char * data () const
 
int size () const
 
bool isOwned () const
 Returns true if this owns its own memory, and false otherwise. More...
 
SharedBuffer releaseBuffer ()
 
BSONObj toBson () const &
 
BSONObj releaseToBson ()
 
BSONObj toBson () &&
 
RecordData getOwned () const
 
void makeOwned ()
 

Private Attributes

const char * _data
 
int _size
 
SharedBuffer _ownedData
 

Constructor & Destructor Documentation

◆ RecordData() [1/3]

mongo::RecordData::RecordData ( )
inline

◆ RecordData() [2/3]

mongo::RecordData::RecordData ( const char *  data,
int  size 
)
inline

◆ RecordData() [3/3]

mongo::RecordData::RecordData ( SharedBuffer  ownedData,
int  size 
)
inline

Member Function Documentation

◆ data()

const char* mongo::RecordData::data ( ) const
inline

◆ getOwned()

RecordData mongo::RecordData::getOwned ( ) const
inline

◆ isOwned()

bool mongo::RecordData::isOwned ( ) const
inline

Returns true if this owns its own memory, and false otherwise.

◆ makeOwned()

void mongo::RecordData::makeOwned ( )
inline

◆ releaseBuffer()

SharedBuffer mongo::RecordData::releaseBuffer ( )
inline

◆ releaseToBson()

BSONObj mongo::RecordData::releaseToBson ( )
inline

◆ size()

int mongo::RecordData::size ( ) const
inline

◆ toBson() [1/2]

BSONObj mongo::RecordData::toBson ( ) const &
inline

◆ toBson() [2/2]

BSONObj mongo::RecordData::toBson ( ) &&
inline

Member Data Documentation

◆ _data

const char* mongo::RecordData::_data
private

◆ _ownedData

SharedBuffer mongo::RecordData::_ownedData
private

◆ _size

int mongo::RecordData::_size
private

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