diff --git a/ConflictSet.cpp b/ConflictSet.cpp index e69de29..94e25d6 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -0,0 +1,38 @@ +#include "ConflictSet.h" + +#include + +struct ConflictSet::Impl { + explicit Impl(int64_t oldestVersion) noexcept {} + void check(const ReadRange *reads, Result *results, int count) const {} + + void addWrites(const WriteRange *writes, int count) {} + + void setOldestVersion(int64_t oldestVersion) {} +}; + +void ConflictSet::check(const ReadRange *reads, Result *results, + int count) const { + return impl->check(reads, results, count); +} + +void ConflictSet::addWrites(const WriteRange *writes, int count) { + return impl->addWrites(writes, count); +} + +void ConflictSet::setOldestVersion(int64_t oldestVersion) { + return impl->setOldestVersion(oldestVersion); +} + +ConflictSet::ConflictSet(int64_t oldestVersion) + : impl(new Impl{oldestVersion}) {} + +ConflictSet::~ConflictSet() { delete impl; } + +ConflictSet::ConflictSet(ConflictSet &&other) noexcept + : impl(std::exchange(other.impl, nullptr)) {} + +ConflictSet &ConflictSet::operator=(ConflictSet &&other) noexcept { + impl = std::exchange(other.impl, nullptr); + return *this; +} diff --git a/ConflictSet.h b/ConflictSet.h index b132c37..2863d0d 100644 --- a/ConflictSet.h +++ b/ConflictSet.h @@ -56,5 +56,6 @@ struct ConflictSet { ConflictSet &operator=(const ConflictSet &) = delete; private: - struct Impl *impl; + struct Impl; + Impl *impl; }; \ No newline at end of file