2015-12-06 23:37:42 +08:00
|
|
|
#pragma once
|
2015-07-07 22:18:26 +08:00
|
|
|
|
2015-12-06 23:37:42 +08:00
|
|
|
#include "mvcc/record.hpp"
|
2017-02-04 16:01:15 +08:00
|
|
|
#include "mvcc/version_list.hpp"
|
2017-11-14 15:47:50 +08:00
|
|
|
#include "storage/address.hpp"
|
2017-03-01 02:38:57 +08:00
|
|
|
#include "storage/property_value_store.hpp"
|
2018-01-16 17:09:15 +08:00
|
|
|
#include "storage/types.hpp"
|
2015-07-07 22:18:26 +08:00
|
|
|
|
2017-02-04 16:01:15 +08:00
|
|
|
class Vertex;
|
2016-11-29 11:08:08 +08:00
|
|
|
|
2017-02-04 16:01:15 +08:00
|
|
|
class Edge : public mvcc::Record<Edge> {
|
2017-11-14 15:47:50 +08:00
|
|
|
using VertexAddress = storage::Address<mvcc::VersionList<Vertex>>;
|
|
|
|
|
2017-02-18 18:54:37 +08:00
|
|
|
public:
|
2018-01-16 17:09:15 +08:00
|
|
|
Edge(VertexAddress from, VertexAddress to, storage::EdgeType edge_type)
|
2017-02-15 21:10:16 +08:00
|
|
|
: from_(from), to_(to), edge_type_(edge_type) {}
|
2017-11-14 15:47:50 +08:00
|
|
|
|
2017-09-27 20:45:50 +08:00
|
|
|
// Returns new Edge with copy of data stored in this Edge, but without
|
|
|
|
// copying superclass' members.
|
|
|
|
Edge *CloneData() { return new Edge(*this); }
|
2017-02-15 21:10:16 +08:00
|
|
|
|
2017-11-14 15:47:50 +08:00
|
|
|
VertexAddress from_;
|
|
|
|
VertexAddress to_;
|
2018-01-16 17:09:15 +08:00
|
|
|
storage::EdgeType edge_type_;
|
2017-12-29 19:35:21 +08:00
|
|
|
PropertyValueStore properties_;
|
2017-09-27 20:45:50 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
Edge(const Edge &other)
|
|
|
|
: mvcc::Record<Edge>(),
|
|
|
|
from_(other.from_),
|
|
|
|
to_(other.to_),
|
|
|
|
edge_type_(other.edge_type_),
|
|
|
|
properties_(other.properties_) {}
|
2015-12-06 23:37:42 +08:00
|
|
|
};
|