9 #include <unordered_map>
12 #include "common/datatypes/Value.h"
13 #include "common/thrift/ThriftTypes.h"
19 std::unordered_map<std::string, Value> props;
22 Tag(
Tag&& tag) noexcept : name(std::move(tag.name)), props(std::move(tag.props)) {}
23 Tag(
const Tag& tag) : name(tag.name), props(tag.props) {}
24 Tag(std::string tagName, std::unordered_map<std::string, Value> tagProps)
25 : name(std::move(tagName)), props(std::move(tagProps)) {}
36 std::string toString()
const;
38 Tag& operator=(
Tag&& rhs) noexcept {
40 name = std::move(rhs.name);
41 props = std::move(rhs.props);
46 Tag& operator=(
const Tag& rhs) {
54 bool operator==(
const Tag& rhs)
const {
55 return name == rhs.name && props == rhs.props;
61 std::vector<Tag> tags;
65 Vertex(
Vertex&& v) noexcept : vid(std::move(v.vid)), tags(std::move(v.tags)) {}
66 Vertex(
Value id, std::vector<Tag> t) : vid(std::move(
id)), tags(std::move(t)) {}
77 std::string toString()
const;
83 bool operator==(
const Vertex& rhs)
const {
84 return vid == rhs.vid && tags == rhs.tags;
87 bool operator<(
const Vertex& rhs)
const;
89 bool contains(
const Value& key)
const;
91 const Value& value(
const std::string& key)
const;
95 auto temp = std::move(a);
100 inline std::ostream& operator<<(std::ostream& os,
const Vertex& v) {
101 return os << v.toString();
110 struct hash<nebula::Tag> {
111 std::size_t operator()(
const nebula::Tag& h)
const noexcept;
115 struct hash<nebula::Vertex> {