18 #ifndef FOEDUS_EPOCH_HPP_
19 #define FOEDUS_EPOCH_HPP_
102 EpochInteger
value()
const {
return epoch_; }
139 if (epoch_ >= other.epoch_) {
140 return epoch_ - other.epoch_;
156 epoch_ = other.epoch_;
168 epoch_ = other.epoch_;
179 int64_t diff =
static_cast<int64_t
>(other.epoch_) - static_cast<int64_t>(epoch_);
207 #endif // FOEDUS_EPOCH_HPP_
Constants
Defines constant values.
bool operator!=(const Epoch &other) const
The first epoch (before wrap-around) that might have transactions is ep-3.
Bits to represent an epoch.
Usually, current epoch -1 is the grace period before being durable.
Epoch values wrap around at this value.
uint32_t subtract(const Epoch &other) const
Returns the number epochs from the given epoch to this epoch accounting for wrap-around.
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
void reset()
Clears this epoch variable so that it points to an invalid epoch.
bool operator<=(const Epoch &other) const
uint32_t EpochInteger
Unsigned integer representation of epoch.
#define CXX11_NOEXCEPT
Used in public headers in place of "noexcept" of C++11.
friend std::ostream & operator<<(std::ostream &o, const Epoch &v)
Zero is always reserved for invalid epoch.
bool operator>(const Epoch &other) const
bool operator<(const Epoch &other) const
Epoch(EpochInteger value) noexcept
Construct an epoch of specified integer representation.
bool operator==(const Epoch &other) const
Epoch() noexcept
Construct an invalid epoch.
bool operator>=(const Epoch &other) const
void store_max(const Epoch &other)
Kind of std::max(this, other).
const Epoch INVALID_EPOCH
A constant epoch object that represents an invalid epoch.
As there is no transaction in ep-1, initial durable_epoch is 1.
#define ASSERT_ND(x)
A warning-free wrapper macro of assert() that has no performance effect in release mode even when 'x'...
bool before(const Epoch &other) const
Returns if this epoch is before the given epoch in the sense of distance defined in RFC 1982...
EpochInteger value() const
Returns the raw integer representation.
void store_min(const Epoch &other)
Kind of std::min(this, other).