PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
receive_network_io_job.h
Go to the documentation of this file.
1// BSD 3-Clause License
2// Copyright (c) 2021-2025, 🍀☀🌕🌥 🌊
3// See the LICENSE file in the project root for full license information.
4
18#pragma once
19
23
24#include <cstdint>
25#include <functional>
26#include <string>
27#include <vector>
28
30
45public:
47 using data_callback = std::function<void(uint64_t session_id,
48 std::vector<uint8_t> data)>;
49
51 using error_callback = std::function<void(uint64_t session_id,
52 const std::string& error)>;
53
62 receive_network_io_job(uint64_t session_id,
63 std::vector<uint8_t> data,
64 data_callback on_data = nullptr,
65 error_callback on_error = nullptr);
66
67 ~receive_network_io_job() override = default;
68
69 // Non-copyable, movable
74
83 [[nodiscard]] auto execute(pipeline_coordinator& coordinator) -> VoidResult override;
84
88 [[nodiscard]] auto get_context() const noexcept -> const job_context& override;
89 [[nodiscard]] auto get_context() noexcept -> job_context& override;
90
94 [[nodiscard]] auto get_name() const -> std::string override;
95
99 [[nodiscard]] auto get_data() const noexcept -> const std::vector<uint8_t>&;
100
104 [[nodiscard]] auto get_session_id() const noexcept -> uint64_t;
105
106private:
108 std::vector<uint8_t> data_;
111};
112
113} // namespace kcenon::pacs::network::pipeline
Coordinates the 6-stage DICOM I/O pipeline.
Job for receiving PDU data from network connections.
auto get_name() const -> std::string override
Get the job name.
auto get_session_id() const noexcept -> uint64_t
Get the session ID.
receive_network_io_job & operator=(const receive_network_io_job &)=delete
receive_network_io_job & operator=(receive_network_io_job &&)=default
auto get_data() const noexcept -> const std::vector< uint8_t > &
Get the received data.
auto execute(pipeline_coordinator &coordinator) -> VoidResult override
Execute the receive job.
std::function< void(uint64_t session_id, std::vector< uint8_t > data)> data_callback
Callback type for received data.
auto get_context() const noexcept -> const job_context &override
Get the job context.
receive_network_io_job(uint64_t session_id, std::vector< uint8_t > data, data_callback on_data=nullptr, error_callback on_error=nullptr)
Construct a receive job.
std::function< void(uint64_t session_id, const std::string &error)> error_callback
Callback type for connection errors.
receive_network_io_job(receive_network_io_job &&)=default
receive_network_io_job(const receive_network_io_job &)=delete
kcenon::pacs::VoidResult VoidResult
VoidResult type alias for operations without return value.
Definition association.h:59
Main coordinator for the 6-stage DICOM I/O pipeline.
Job type definitions for the 6-stage DICOM I/O pipeline.
Result<T> type aliases and helpers for PACS system.
Context information attached to pipeline jobs for tracking.