summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/optime.h
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 00:22:50 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2015-06-20 10:56:02 -0400
commit9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch)
tree3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/db/repl/optime.h
parent01965cf52bce6976637ecb8f4a622aeb05ab256a (diff)
downloadmongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/db/repl/optime.h')
-rw-r--r--src/mongo/db/repl/optime.h92
1 files changed, 46 insertions, 46 deletions
diff --git a/src/mongo/db/repl/optime.h b/src/mongo/db/repl/optime.h
index 76b21eaca2e..5fb4faea093 100644
--- a/src/mongo/db/repl/optime.h
+++ b/src/mongo/db/repl/optime.h
@@ -35,65 +35,65 @@
namespace mongo {
namespace repl {
- /**
- * OpTime encompasses a Timestamp (which itself is composed of two 32-bit integers, which can
- * represent a time_t and a counter), and a 64-bit Term number. OpTime can be used to
- * label every op in an oplog with a unique identifier.
- */
+/**
+ * OpTime encompasses a Timestamp (which itself is composed of two 32-bit integers, which can
+ * represent a time_t and a counter), and a 64-bit Term number. OpTime can be used to
+ * label every op in an oplog with a unique identifier.
+ */
- class OpTime {
- public:
- // The default term after the first time upgrading from protocol version 0.
- //
- // This is also the first term for nodes that were recently started up but have not
- // yet joined the cluster, all in protocol version 1.
- static const long long kDefaultTerm = 0;
+class OpTime {
+public:
+ // The default term after the first time upgrading from protocol version 0.
+ //
+ // This is also the first term for nodes that were recently started up but have not
+ // yet joined the cluster, all in protocol version 1.
+ static const long long kDefaultTerm = 0;
- OpTime() = default;
- OpTime(Timestamp ts, long long term);
+ OpTime() = default;
+ OpTime(Timestamp ts, long long term);
- Timestamp getTimestamp() const;
+ Timestamp getTimestamp() const;
- long long getSecs() const;
+ long long getSecs() const;
- long long getTerm() const;
+ long long getTerm() const;
- std::string toString() const;
+ std::string toString() const;
- // Returns true when this OpTime is not yet initialized.
- bool isNull() const;
+ // Returns true when this OpTime is not yet initialized.
+ bool isNull() const;
- inline bool operator==(const OpTime& rhs) const {
- return std::tie(_term, _timestamp) == std::tie(rhs._term, rhs._timestamp);
- }
+ inline bool operator==(const OpTime& rhs) const {
+ return std::tie(_term, _timestamp) == std::tie(rhs._term, rhs._timestamp);
+ }
- inline bool operator<(const OpTime& rhs) const {
- // Compare term first, then the opTimes.
- return std::tie(_term, _timestamp) < std::tie(rhs._term, rhs._timestamp);
- }
+ inline bool operator<(const OpTime& rhs) const {
+ // Compare term first, then the opTimes.
+ return std::tie(_term, _timestamp) < std::tie(rhs._term, rhs._timestamp);
+ }
- inline bool operator!=(const OpTime& rhs) const {
- return !(*this == rhs);
- }
+ inline bool operator!=(const OpTime& rhs) const {
+ return !(*this == rhs);
+ }
- inline bool operator<=(const OpTime& rhs) const {
- return *this < rhs || *this == rhs;
- }
+ inline bool operator<=(const OpTime& rhs) const {
+ return *this < rhs || *this == rhs;
+ }
- inline bool operator>(const OpTime& rhs) const {
- return !(*this <= rhs);
- }
+ inline bool operator>(const OpTime& rhs) const {
+ return !(*this <= rhs);
+ }
- inline bool operator>=(const OpTime& rhs) const {
- return !(*this < rhs);
- }
+ inline bool operator>=(const OpTime& rhs) const {
+ return !(*this < rhs);
+ }
- friend std::ostream& operator<<(std::ostream& out, const OpTime& opTime);
+ friend std::ostream& operator<<(std::ostream& out, const OpTime& opTime);
- private:
- Timestamp _timestamp;
- long long _term = kDefaultTerm;
- };
+private:
+ Timestamp _timestamp;
+ long long _term = kDefaultTerm;
+};
-} // namespace repl
-} // namespace mongo
+} // namespace repl
+} // namespace mongo