Add PImpl scaffolding

This commit is contained in:
2024-01-17 11:03:10 -08:00
parent 8edcd02f91
commit c6ff1ff64d
2 changed files with 40 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
#include "ConflictSet.h"
#include <utility>
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;
}