21 std::vector<uint8_t> data,
25 , on_data_(std::
move(on_data))
26 , on_error_(std::
move(on_error)) {
32 std::chrono::duration_cast<std::chrono::nanoseconds>(
33 std::chrono::steady_clock::now().time_since_epoch()
44 on_error_(context_.session_id,
"Empty data received");
47 "Empty data received");
52 on_data_(context_.session_id,
data_);
56 context_.job_id = coordinator.generate_job_id();
59 auto decode_job = std::make_unique<pdu_decode_job>(
65 decode_job->get_context() = context_;
68 return coordinator.submit_to_stage(
83 return "receive_network_io_job[session=" +
88 -> const std::vector<uint8_t>& {
Coordinates the 6-stage DICOM I/O pipeline.
auto get_name() const -> std::string override
Get the job name.
std::vector< uint8_t > data_
auto get_session_id() const noexcept -> uint64_t
Get the session ID.
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.
@ move
C-MOVE move request/response.
@ other
Unknown or other category.
@ network_receive
Stage 1: Receive raw PDU bytes from network.
@ pdu_decode
Stage 2: Decode PDU bytes into structured data.
kcenon::pacs::VoidResult VoidResult
VoidResult type alias for operations without return value.
VoidResult pacs_void_error(int code, const std::string &message, const std::string &details="")
Create a PACS void error result.
PDU decoding job for Stage 2 of the pipeline.
Network I/O receive job for Stage 1 of the pipeline.
Context information attached to pipeline jobs for tracking.
pipeline_stage stage
Current pipeline stage.
job_category category
Job category for metrics.
uint64_t enqueue_time_ns
Timestamp when job entered the pipeline (nanoseconds since epoch)
uint64_t session_id
Session/association identifier.