1 /*************************************************************************
3 * Copyright 2016 Realm Inc.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 **************************************************************************/
19 #ifndef REALM_HANDOVER_DEFS
20 #define REALM_HANDOVER_DEFS
27 enum class ConstSourcePayload { Copy, Stay };
28 enum class MutableSourcePayload { Move };
30 struct RowBaseHandoverPatch;
31 struct TableViewHandoverPatch;
33 struct TableHandoverPatch {
40 struct LinkViewHandoverPatch {
41 std::unique_ptr<TableHandoverPatch> m_table;
46 // Base class for handover patches for query nodes. Subclasses are declared in query_engine.hpp.
47 struct QueryNodeHandoverPatch {
48 virtual ~QueryNodeHandoverPatch() = default;
51 using QueryNodeHandoverPatches = std::vector<std::unique_ptr<QueryNodeHandoverPatch>>;
53 struct QueryHandoverPatch {
54 std::unique_ptr<TableHandoverPatch> m_table;
55 std::unique_ptr<TableViewHandoverPatch> table_view_data;
56 std::unique_ptr<LinkViewHandoverPatch> link_view_data;
57 QueryNodeHandoverPatches m_node_data;
60 struct DescriptorOrderingHandoverPatch {
61 std::vector<std::vector<std::vector<size_t>>> columns;
62 std::vector<std::vector<bool>> ascending;
65 struct TableViewHandoverPatch {
66 std::unique_ptr<TableHandoverPatch> m_table;
67 std::unique_ptr<RowBaseHandoverPatch> linked_row;
70 QueryHandoverPatch query_patch;
71 std::unique_ptr<LinkViewHandoverPatch> linkview_patch;
72 std::unique_ptr<DescriptorOrderingHandoverPatch> descriptors_patch;
76 struct RowBaseHandoverPatch {
77 std::unique_ptr<TableHandoverPatch> m_table;
82 } // end namespace Realm