ORE Studio 0.0.4
Loading...
Searching...
No Matches
dataset_dependency_protocol.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 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_DEPENDENCY_PROTOCOL_HPP
21#define ORES_DQ_MESSAGING_DATASET_DEPENDENCY_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_dependency.hpp"
30
31namespace ores::dq::messaging {
32
37 std::vector<std::byte> serialize() const;
38 static std::expected<get_dataset_dependencies_request,
39 ores::utility::serialization::error_code>
40 deserialize(std::span<const std::byte> data);
41};
42
43std::ostream& operator<<(std::ostream& s, const get_dataset_dependencies_request& v);
44
49 std::vector<domain::dataset_dependency> dependencies;
50
51 std::vector<std::byte> serialize() const;
52 static std::expected<get_dataset_dependencies_response,
53 ores::utility::serialization::error_code>
54 deserialize(std::span<const std::byte> data);
55};
56
57std::ostream& operator<<(std::ostream& s, const get_dataset_dependencies_response& v);
58
63 std::string dataset_code;
64
65 std::vector<std::byte> serialize() const;
67 ores::utility::serialization::error_code>
68 deserialize(std::span<const std::byte> data);
69};
70
71std::ostream& operator<<(std::ostream& s, const get_dataset_dependencies_by_dataset_request& v);
72
77 std::vector<domain::dataset_dependency> dependencies;
78
79 std::vector<std::byte> serialize() const;
81 ores::utility::serialization::error_code>
82 deserialize(std::span<const std::byte> data);
83};
84
85std::ostream& operator<<(std::ostream& s, const get_dataset_dependencies_by_dataset_response& v);
86
87}
88
89namespace ores::comms::messaging {
90
91template<>
92struct message_traits<dq::messaging::get_dataset_dependencies_request> {
95 static constexpr message_type request_message_type =
96 message_type::get_dataset_dependencies_request;
97};
98
99template<>
100struct message_traits<dq::messaging::get_dataset_dependencies_by_dataset_request> {
103 static constexpr message_type request_message_type =
104 message_type::get_dataset_dependencies_by_dataset_request;
105};
106
107}
108
109#endif
Contains messaging related infrastructure in the comms library.
Definition assets_protocol.hpp:122
Request to retrieve all dataset dependencies.
Definition dataset_dependency_protocol.hpp:36
Response containing all dataset dependencies.
Definition dataset_dependency_protocol.hpp:48
Request to retrieve dataset dependencies for a specific dataset.
Definition dataset_dependency_protocol.hpp:62
Response containing dataset dependencies for a specific dataset.
Definition dataset_dependency_protocol.hpp:76