Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27743

Implement LogicalTime

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.5.3
    • None
    • Sharding
    • None
    • Fully Compatible
    • Sharding 2017-02-13

    Description

      The LogicalTime class contains the time and defines the operations allowed with this time.

      class LogicalTime {
        public:
            LogicalTime();
            LogicalTime(Timestamp);
            
            LogicalTime(const LogicalTime&) = default;
            LogicalTime(LogicalTime&&) = default;
        
            LogicalTime& operator=(const LogicalTime&) = default;
            LogicalTime& operator=(LogicalTime&&) = default;
       
            Timestamp asTimestamp() const;
       
            // increments the clock
            void addTicks(unsigned ticks); 
            std::string toString() const;
       
        private:
           uint64_t _time{0};
        };
      

      Add unit tests to validate the API

      Attachments

        Activity

          People

            misha.tyulenev@mongodb.com Misha Tyulenev
            misha.tyulenev@mongodb.com Misha Tyulenev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: