// Copyright 2022 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source // License, and you may not use this file except in compliance with the Business Source License. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. #pragma once #include #include #include #include #include #include #include #include #include #include "coordinator/hybrid_logical_clock.hpp" #include "storage/v3/id_types.hpp" #include "storage/v3/property_value.hpp" #include "storage/v3/result.hpp" namespace memgraph::msgs { using coordinator::Hlc; using storage::v3::LabelId; struct Value; struct Label { LabelId id; friend bool operator==(const Label &lhs, const Label &rhs) { return lhs.id == rhs.id; } }; // TODO(kostasrim) update this with CompoundKey, same for the rest of the file. using PrimaryKey = std::vector; using VertexId = std::pair; inline bool operator==(const VertexId &lhs, const VertexId &rhs) { return (lhs.first == rhs.first) && (lhs.second == rhs.second); } using Gid = size_t; using PropertyId = memgraph::storage::v3::PropertyId; using EdgeTypeId = memgraph::storage::v3::EdgeTypeId; struct EdgeType { EdgeTypeId id; friend bool operator==(const EdgeType &lhs, const EdgeType &rhs) = default; }; struct EdgeId { Gid gid; friend bool operator==(const EdgeId &lhs, const EdgeId &rhs) { return lhs.gid == rhs.gid; } friend bool operator<(const EdgeId &lhs, const EdgeId &rhs) { return lhs.gid < rhs.gid; } }; struct Edge { VertexId src; VertexId dst; std::vector> properties; EdgeId id; EdgeType type; friend bool operator==(const Edge &lhs, const Edge &rhs) { return lhs.id == rhs.id; } }; struct Vertex { VertexId id; std::vector