29 #include "mongo/db/repl/optime.h"
30 #include "../util/time_support.h"
39 inline BSONObjBuilder& BSONObjBuilder::appendTimestamp(
const StringData& fieldName ,
unsigned long long time ,
unsigned int inc ) {
40 OpTime t( (
unsigned) (time / 1000) , inc );
41 appendTimestamp( fieldName , t.asDate() );
46 appendTimestamp(fieldName, optime.asDate());
50 inline OpTime BSONElement::_opTime()
const {
52 return OpTime( *reinterpret_cast< const unsigned long long* >(
value() ) );
56 inline std::string BSONElement::_asCode()
const {
64 log() <<
"can't convert type: " << (int)(
type()) <<
" to code" << std::endl;
66 uassert( 10062 ,
"not code" , 0 );
70 inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(
const DateNowLabeler&
id) {
72 _fieldName = StringData();
76 inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(
const NullLabeler&
id) {
78 _fieldName = StringData();
82 inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(
const UndefinedLabeler&
id) {
83 _builder->appendUndefined(_fieldName);
84 _fieldName = StringData();
89 inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(
const MinKeyLabeler&
id) {
90 _builder->appendMinKey(_fieldName);
91 _fieldName = StringData();
95 inline BSONObjBuilder& BSONObjBuilderValueStream::operator<<(
const MaxKeyLabeler&
id) {
96 _builder->appendMaxKey(_fieldName);
97 _fieldName = StringData();