PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
pipeline_job_types.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
33#pragma once
34
35#include <cstdint>
36#include <string_view>
37
39
49enum class pipeline_stage : uint8_t {
52
54 pdu_decode = 1,
55
57 dimse_process = 2,
58
61
64
66 network_send = 5,
67
69 stage_count = 6
70};
71
77[[nodiscard]] constexpr auto get_stage_name(pipeline_stage stage) noexcept
78 -> std::string_view {
79 switch (stage) {
81 return "network_receive";
83 return "pdu_decode";
85 return "dimse_process";
87 return "storage_query_exec";
89 return "response_encode";
91 return "network_send";
92 default:
93 return "unknown";
94 }
95}
96
102[[nodiscard]] constexpr auto is_blocking_stage(pipeline_stage stage) noexcept
103 -> bool {
105}
106
112[[nodiscard]] constexpr auto is_network_io_stage(pipeline_stage stage) noexcept
113 -> bool {
114 return stage == pipeline_stage::network_receive ||
116}
117
122enum class job_category : uint8_t {
124 echo = 0,
125
127 store = 1,
128
130 find = 2,
131
133 get = 3,
134
136 move = 4,
137
139 association = 5,
140
142 control = 6,
143
145 other = 7
146};
147
153[[nodiscard]] constexpr auto get_category_name(job_category category) noexcept
154 -> std::string_view {
155 switch (category) {
157 return "echo";
159 return "store";
161 return "find";
163 return "get";
165 return "move";
167 return "association";
169 return "control";
170 default:
171 return "other";
172 }
173}
174
184 uint64_t job_id{0};
185
187 uint64_t session_id{0};
188
190 uint16_t message_id{0};
191
194
197
199 uint64_t enqueue_time_ns{0};
200
202 uint32_t sequence_number{0};
203
205 uint8_t priority{128};
206};
207
208} // namespace kcenon::pacs::network::pipeline
constexpr auto is_blocking_stage(pipeline_stage stage) noexcept -> bool
Check if a stage allows blocking operations.
job_category
Categories for pipeline jobs used in metrics and monitoring.
@ move
C-MOVE move request/response.
@ store
C-STORE storage request/response.
@ association
Association management (A-ASSOCIATE, A-RELEASE, A-ABORT)
@ get
C-GET retrieve request/response.
@ echo
C-ECHO verification request/response.
@ find
C-FIND query request/response.
@ control
Internal pipeline control messages.
constexpr auto get_stage_name(pipeline_stage stage) noexcept -> std::string_view
Get the human-readable name of a pipeline stage.
constexpr auto get_category_name(job_category category) noexcept -> std::string_view
Get the human-readable name of a job category.
pipeline_stage
Identifies the 6 stages of the DICOM I/O pipeline.
@ storage_query_exec
Stage 4: Execute storage/query operations (blocking allowed)
@ dimse_process
Stage 3: Process DIMSE messages and route requests.
@ response_encode
Stage 5: Encode response into PDU bytes.
@ network_send
Stage 6: Send PDU bytes to network.
@ network_receive
Stage 1: Receive raw PDU bytes from network.
@ pdu_decode
Stage 2: Decode PDU bytes into structured data.
constexpr auto is_network_io_stage(pipeline_stage stage) noexcept -> bool
Check if a stage handles network I/O.
Context information attached to pipeline jobs for tracking.
pipeline_stage stage
Current pipeline stage.
job_category category
Job category for metrics.
uint16_t message_id
Message ID from DIMSE command (if applicable)
uint32_t sequence_number
Sequence number for ordering within a session.
uint64_t job_id
Unique identifier for this job (monotonically increasing)
uint64_t enqueue_time_ns
Timestamp when job entered the pipeline (nanoseconds since epoch)
uint8_t priority
Priority (lower = higher priority, 0 = highest)
uint64_t session_id
Session/association identifier.