ORE Studio 0.0.4
Loading...
Searching...
No Matches
dataset_bundle_member_protocol.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_DQ_MESSAGING_DATASET_BUNDLE_MEMBER_PROTOCOL_HPP
21#define ORES_DQ_MESSAGING_DATASET_BUNDLE_MEMBER_PROTOCOL_HPP
22
23#include <span>
24#include <iosfwd>
25#include <vector>
26#include <expected>
27#include "ores.comms/messaging/message_types.hpp"
28#include "ores.comms/messaging/message_traits.hpp"
29#include "ores.dq/domain/dataset_bundle_member.hpp"
30
31namespace ores::dq::messaging {
32
33// ============================================================================
34// Dataset Bundle Member Messages
35// ============================================================================
36
41 std::vector<std::byte> serialize() const;
42 static std::expected<get_dataset_bundle_members_request,
43 ores::utility::serialization::error_code>
44 deserialize(std::span<const std::byte> data);
45};
46
47std::ostream& operator<<(std::ostream& s, const get_dataset_bundle_members_request& v);
48
53 std::vector<domain::dataset_bundle_member> members;
54
55 std::vector<std::byte> serialize() const;
56 static std::expected<get_dataset_bundle_members_response,
57 ores::utility::serialization::error_code>
58 deserialize(std::span<const std::byte> data);
59};
60
61std::ostream& operator<<(std::ostream& s, const get_dataset_bundle_members_response& v);
62
67 std::string bundle_code;
68
69 std::vector<std::byte> serialize() const;
71 ores::utility::serialization::error_code>
72 deserialize(std::span<const std::byte> data);
73};
74
75std::ostream& operator<<(std::ostream& s, const get_dataset_bundle_members_by_bundle_request& v);
76
81 std::vector<domain::dataset_bundle_member> members;
82
83 std::vector<std::byte> serialize() const;
85 ores::utility::serialization::error_code>
86 deserialize(std::span<const std::byte> data);
87};
88
89std::ostream& operator<<(std::ostream& s, const get_dataset_bundle_members_by_bundle_response& v);
90
96
97 std::vector<std::byte> serialize() const;
98 static std::expected<save_dataset_bundle_member_request,
99 ores::utility::serialization::error_code>
100 deserialize(std::span<const std::byte> data);
101};
102
103std::ostream& operator<<(std::ostream& s, const save_dataset_bundle_member_request& v);
104
109 bool success;
110 std::string message;
111
112 std::vector<std::byte> serialize() const;
113 static std::expected<save_dataset_bundle_member_response,
114 ores::utility::serialization::error_code>
115 deserialize(std::span<const std::byte> data);
116};
117
118std::ostream& operator<<(std::ostream& s, const save_dataset_bundle_member_response& v);
119
124 std::string bundle_code;
125 std::string dataset_code;
126 bool success;
127 std::string message;
128};
129
130std::ostream& operator<<(std::ostream& s, const delete_dataset_bundle_member_result& v);
131
136 std::string bundle_code;
137 std::string dataset_code;
138};
139
140std::ostream& operator<<(std::ostream& s, const dataset_bundle_member_key& v);
141
146 std::vector<dataset_bundle_member_key> keys;
147
148 std::vector<std::byte> serialize() const;
149 static std::expected<delete_dataset_bundle_member_request,
150 ores::utility::serialization::error_code>
151 deserialize(std::span<const std::byte> data);
152};
153
154std::ostream& operator<<(std::ostream& s, const delete_dataset_bundle_member_request& v);
155
160 std::vector<delete_dataset_bundle_member_result> results;
161
162 std::vector<std::byte> serialize() const;
163 static std::expected<delete_dataset_bundle_member_response,
164 ores::utility::serialization::error_code>
165 deserialize(std::span<const std::byte> data);
166};
167
168std::ostream& operator<<(std::ostream& s, const delete_dataset_bundle_member_response& v);
169
170}
171
172namespace ores::comms::messaging {
173
174// Dataset Bundle Member traits
175template<>
176struct message_traits<dq::messaging::get_dataset_bundle_members_request> {
179 static constexpr message_type request_message_type =
180 message_type::get_dataset_bundle_members_request;
181};
182
183template<>
184struct message_traits<dq::messaging::get_dataset_bundle_members_by_bundle_request> {
187 static constexpr message_type request_message_type =
188 message_type::get_dataset_bundle_members_by_bundle_request;
189};
190
191template<>
192struct message_traits<dq::messaging::save_dataset_bundle_member_request> {
193 using request_type = dq::messaging::save_dataset_bundle_member_request;
194 using response_type = dq::messaging::save_dataset_bundle_member_response;
195 static constexpr message_type request_message_type =
196 message_type::save_dataset_bundle_member_request;
197};
198
199template<>
200struct message_traits<dq::messaging::delete_dataset_bundle_member_request> {
201 using request_type = dq::messaging::delete_dataset_bundle_member_request;
202 using response_type = dq::messaging::delete_dataset_bundle_member_response;
203 static constexpr message_type request_message_type =
204 message_type::delete_dataset_bundle_member_request;
205};
206
207}
208
209#endif
Contains messaging related infrastructure in the comms library.
Definition assets_protocol.hpp:122
Links a dataset to a bundle.
Definition dataset_bundle_member.hpp:39
Request to retrieve all dataset bundle members.
Definition dataset_bundle_member_protocol.hpp:40
Response containing all dataset bundle members.
Definition dataset_bundle_member_protocol.hpp:52
Request to retrieve dataset bundle members for a specific bundle.
Definition dataset_bundle_member_protocol.hpp:66
Response containing dataset bundle members for a bundle.
Definition dataset_bundle_member_protocol.hpp:80
Request to save a dataset bundle member (create or update).
Definition dataset_bundle_member_protocol.hpp:94
Response confirming dataset bundle member save operation.
Definition dataset_bundle_member_protocol.hpp:108
Result for a single dataset bundle member deletion.
Definition dataset_bundle_member_protocol.hpp:123
Key identifying a dataset bundle member for deletion.
Definition dataset_bundle_member_protocol.hpp:135
Request to delete one or more dataset bundle members.
Definition dataset_bundle_member_protocol.hpp:145
Response confirming dataset bundle member deletion(s).
Definition dataset_bundle_member_protocol.hpp:159