34#include <unordered_map>
104 const std::vector<uint8_t>& data)>;
109 const std::vector<uint8_t>& data)>;
113 const std::string& event)>;
160 [[nodiscard]]
auto is_running() const noexcept ->
bool;
184 [[nodiscard]] auto
get_session(uint64_t session_id)
Adapter for integrating pipeline with DICOM server components.
void set_session_event_callback(session_event_callback callback)
Set the session event callback.
void set_send_callback(send_callback callback)
Set the network send callback.
service_handler c_find_handler_
auto get_active_session_count() const noexcept -> size_t
Get number of active sessions.
auto get_metrics() noexcept -> pipeline_metrics &
Get the pipeline metrics.
auto is_running() const noexcept -> bool
Check if the adapter is running.
auto start() -> VoidResult
Start the pipeline adapter.
service_handler c_store_handler_
Service handlers.
void register_c_get_handler(service_handler handler)
Register C-GET handler.
void register_session(uint64_t session_id, session_context context)
Register a new session.
service_handler c_move_handler_
std::unordered_map< uint64_t, session_context > sessions_
Session registry.
association_callback association_callback_
auto stop() -> VoidResult
Stop the pipeline adapter.
std::unique_ptr< pipeline_coordinator > coordinator_
Pipeline coordinator.
auto get_session(uint64_t session_id) -> std::optional< session_context >
Get session context.
pipeline_adapter(pipeline_adapter &&)=delete
void register_c_find_handler(service_handler handler)
Register C-FIND handler.
void unregister_session(uint64_t session_id)
Unregister a session.
std::function< VoidResult(uint64_t session_id, const std::vector< uint8_t > &data)> send_callback
Type for network send callback.
auto get_coordinator() noexcept -> pipeline_coordinator &
Get the underlying coordinator.
storage_query_exec_job::service_handler service_handler
Service handler type.
void register_c_store_handler(service_handler handler)
Register C-STORE handler.
std::mutex handlers_mutex_
void on_connection_closed(uint64_t session_id)
Handle connection closed event.
std::function< void(uint64_t session_id, const std::string &event)> session_event_callback
Type for session event callback.
void on_job_completed(const job_context &ctx, bool success)
Handle job completion.
pipeline_adapter & operator=(pipeline_adapter &&)=delete
void set_association_callback(association_callback callback)
Set the association event callback.
pipeline_adapter()
Construct adapter with default configuration.
pipeline_adapter(const pipeline_adapter &)=delete
auto get_handler_for_command(dimse_command_type type) -> service_handler
Get service handler for command type.
std::mutex sessions_mutex_
session_event_callback session_event_callback_
auto on_data_received(uint64_t session_id, std::vector< uint8_t > data) -> VoidResult
Handle incoming data from network.
void register_c_echo_handler(service_handler handler)
Register C-ECHO handler.
pipeline_adapter & operator=(const pipeline_adapter &)=delete
send_callback send_callback_
Callbacks.
~pipeline_adapter()
Destructor - ensures graceful shutdown.
service_handler c_get_handler_
std::function< void(uint64_t session_id, kcenon::pacs::network::pdu_type type, const std::vector< uint8_t > &data)> association_callback
Type for association event callback.
void register_c_move_handler(service_handler handler)
Register C-MOVE handler.
std::mutex callbacks_mutex_
service_handler c_echo_handler_
void on_backpressure(pipeline_stage stage, size_t queue_depth)
Handle backpressure.
Coordinates the 6-stage DICOM I/O pipeline.
Centralized metrics collection for the entire pipeline.
Job for executing storage and query operations.
std::shared_mutex mutex
Mutex for thread-safe access.
dimse_command_type
DICOM DIMSE command types.
pipeline_stage
Identifies the 6 stages of the DICOM I/O pipeline.
pdu_type
PDU (Protocol Data Unit) types as defined in DICOM PS3.8.
kcenon::pacs::VoidResult VoidResult
VoidResult type alias for operations without return value.
Main coordinator for the 6-stage DICOM I/O pipeline.
Job type definitions for the 6-stage DICOM I/O pipeline.
Network I/O receive job for Stage 1 of the pipeline.
Result<T> type aliases and helpers for PACS system.
Network I/O send job for Stage 6 of the pipeline.
Storage and query execution job for Stage 4 of the pipeline.
Context information attached to pipeline jobs for tracking.
Configuration options for the pipeline coordinator.
Context for a DICOM association session.
uint32_t max_pdu_size
Maximum PDU size negotiated.
std::chrono::steady_clock::time_point created_at
Creation timestamp.
std::string local_ae_title
Local AE Title.
uint64_t session_id
Session identifier.
std::chrono::steady_clock::time_point last_activity
Last activity timestamp.
std::string remote_ae_title
Remote AE Title.