userver: formats::bson::Timestamp Class Reference
Loading...
Searching...
No Matches
formats::bson::Timestamp Class Reference

#include <userver/formats/bson/types.hpp>

Detailed Description

BSON Timestamp.

Warning
Do not use this type for time point representation! It is very limited and intended for internal MongoDB use.

Definition at line 166 of file types.hpp.

Public Member Functions

 Timestamp ()
 Creates an empty timestamp.
 
 Timestamp (uint32_t timestamp, uint32_t increment)
 Creates a timestamp with specified values.
 
time_t GetTimestamp () const
 Returns stored unix timestamp.
 
uint32_t GetIncrement () const
 Returns stored increment.
 
uint64_t Pack () const
 Returns packed 64-bit timestamp value.
 
bool operator== (const Timestamp &) const
 
bool operator!= (const Timestamp &) const
 
bool operator< (const Timestamp &) const
 
bool operator> (const Timestamp &) const
 
bool operator<= (const Timestamp &) const
 
bool operator>= (const Timestamp &) const
 

Static Public Member Functions

static Timestamp Unpack (uint64_t)
 Restores a timestamp from the packed form.
 

Constructor & Destructor Documentation

◆ Timestamp()

formats::bson::Timestamp::Timestamp ( )

Creates an empty timestamp.

Note
MongoDB only replaces empty timestamps in top-level fields.

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