0c7f384fd2
Reviewers: mferencevic, ipaljak Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2614
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <limits>
|
|
#include <map>
|
|
|
|
#include "utils/spin_lock.hpp"
|
|
|
|
#include "storage/v2/delta.hpp"
|
|
#include "storage/v2/id_types.hpp"
|
|
|
|
namespace storage {
|
|
|
|
struct Vertex;
|
|
|
|
struct Edge {
|
|
Edge(Gid gid, Delta *delta) : gid(gid), deleted(false), delta(delta) {
|
|
CHECK(delta == nullptr || delta->action == Delta::Action::DELETE_OBJECT)
|
|
<< "Edge must be created with an initial DELETE_OBJECT delta!";
|
|
}
|
|
|
|
Gid gid;
|
|
|
|
std::map<PropertyId, storage::PropertyValue> properties;
|
|
|
|
mutable utils::SpinLock lock;
|
|
bool deleted;
|
|
// uint8_t PAD;
|
|
// uint16_t PAD;
|
|
|
|
Delta *delta;
|
|
};
|
|
|
|
static_assert(alignof(Edge) >= 8, "The Edge should be aligned to at least 8!");
|
|
|
|
inline bool operator==(const Edge &first, const Edge &second) {
|
|
return first.gid == second.gid;
|
|
}
|
|
inline bool operator<(const Edge &first, const Edge &second) {
|
|
return first.gid < second.gid;
|
|
}
|
|
inline bool operator==(const Edge &first, const Gid &second) {
|
|
return first.gid == second;
|
|
}
|
|
inline bool operator<(const Edge &first, const Gid &second) {
|
|
return first.gid < second;
|
|
}
|
|
|
|
} // namespace storage
|