Remove unnecessary constructors from storage v2

Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D2152
This commit is contained in:
Matej Ferencevic 2019-06-28 13:08:15 +02:00
parent cf9bb1f6e2
commit 8169513f57
3 changed files with 6 additions and 45 deletions

View File

@ -19,9 +19,6 @@ struct Delta {
command_id(command_id),
next(nullptr) {}
Delta(const Delta &) = delete;
Delta &operator=(const Delta &) = delete;
Delta(Delta &&other) noexcept
: action(other.action),
value(other.value),
@ -29,17 +26,9 @@ struct Delta {
command_id(other.command_id),
next(other.next.load()) {}
Delta &operator=(Delta &&other) noexcept {
if (this == &other) return *this;
action = other.action;
value = other.value;
timestamp = other.timestamp;
command_id = other.command_id;
next = other.next.load();
return *this;
}
Delta(const Delta &) = delete;
Delta &operator=(const Delta &) = delete;
Delta &operator=(Delta &&other) = delete;
~Delta() {}

View File

@ -21,18 +21,6 @@ struct Transaction {
is_active(true),
must_abort(false) {}
// Default constructor necessary for utils::SkipList.
Transaction()
: transaction_id(std::numeric_limits<uint64_t>::max()),
start_timestamp(std::numeric_limits<uint64_t>::max()),
commit_timestamp(std::numeric_limits<uint64_t>::max()),
command_id(std::numeric_limits<uint64_t>::max()),
is_active(true),
must_abort(false) {}
Transaction(const Transaction &) = delete;
Transaction &operator=(const Transaction &) = delete;
Transaction(Transaction &&other) noexcept
: transaction_id(other.transaction_id),
start_timestamp(other.start_timestamp),
@ -43,20 +31,9 @@ struct Transaction {
is_active(other.is_active),
must_abort(other.must_abort) {}
Transaction &operator=(Transaction &&other) noexcept {
if (this == &other) return *this;
transaction_id = other.transaction_id;
start_timestamp = other.start_timestamp;
commit_timestamp = other.commit_timestamp.load();
command_id = other.command_id;
deltas = std::move(other.deltas);
modified_vertices = std::move(other.modified_vertices);
is_active = other.is_active;
must_abort = other.must_abort;
return *this;
}
Transaction(const Transaction &) = delete;
Transaction &operator=(const Transaction &) = delete;
Transaction &operator=(Transaction &&other) = delete;
~Transaction() {}

View File

@ -12,11 +12,6 @@
namespace storage {
struct Vertex {
// Default constructor necessary for utils::SkipList.
Vertex()
: gid(storage::Gid::FromUint(std::numeric_limits<uint64_t>::max())),
delta(nullptr) {}
Vertex(Gid gid, Delta *delta) : gid(gid), delta(delta) {
CHECK(delta->action == Delta::Action::DELETE_OBJECT)
<< "Vertex must be created with an initial DELETE_OBJECT delta!";