Storage Engine API
mongo::KeyV1Owned Class Reference

#include <key.h>

Inheritance diagram for mongo::KeyV1Owned:
mongo::KeyV1

Public Member Functions

 KeyV1Owned (const BSONObj &obj)
 a BSON object to be translated to KeyV1 format. More...
 
 KeyV1Owned (const KeyV1 &rhs)
 makes a copy (memcpy's the whole thing) More...
 
- Public Member Functions inherited from mongo::KeyV1
 KeyV1 ()
 
 ~KeyV1 ()
 
 KeyV1 (const KeyV1 &rhs)
 
void assign (const KeyV1 &rhs)
 
 KeyV1 (const char *keyData)
 
int woCompare (const KeyV1 &r, const Ordering &o) const
 
bool woEqual (const KeyV1 &r) const
 
BSONObj toBson () const
 
std::string toString () const
 
const char * data () const
 get the key data we want to store in the btree bucket More...
 
int dataSize () const
 
BSONElement _firstElement () const
 only used by geo, which always has bson keys More...
 
bool isCompactFormat () const
 
bool isValid () const
 

Private Member Functions

void operator= (const KeyV1Owned &)
 
void traditional (const BSONObj &obj)
 object cannot be represented in compact format. More...
 

Private Attributes

StackBufBuilder b
 

Additional Inherited Members

- Protected Types inherited from mongo::KeyV1
enum  { IsBSON = 0xff }
 
- Protected Member Functions inherited from mongo::KeyV1
BSONObj bson () const
 
- Protected Attributes inherited from mongo::KeyV1
const unsigned char * _keyData
 

Constructor & Destructor Documentation

◆ KeyV1Owned() [1/2]

mongo::KeyV1Owned::KeyV1Owned ( const BSONObj &  obj)

a BSON object to be translated to KeyV1 format.

If the object isn't representable in KeyV1 format (which happens, intentionally, at times) it will stay as bson herein.

◆ KeyV1Owned() [2/2]

mongo::KeyV1Owned::KeyV1Owned ( const KeyV1 rhs)

makes a copy (memcpy's the whole thing)

Member Function Documentation

◆ operator=()

void mongo::KeyV1Owned::operator= ( const KeyV1Owned )
private

◆ traditional()

void mongo::KeyV1Owned::traditional ( const BSONObj &  obj)
private

object cannot be represented in compact format.

so store in traditional bson format with a leading sentinel byte IsBSON to indicate it's in that format.

Given that the KeyV1Owned constructor already grabbed a bufbuilder, we reuse it here so that we don't have to do an extra malloc.

Member Data Documentation

◆ b

StackBufBuilder mongo::KeyV1Owned::b
private

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