PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::network::pipeline::pipeline_adapter Class Reference

Adapter for integrating pipeline with DICOM server components. More...

#include <pipeline_adapter.h>

Collaboration diagram for kcenon::pacs::network::pipeline::pipeline_adapter:
Collaboration graph

Public Types

using send_callback
 Type for network send callback.
 
using association_callback
 Type for association event callback.
 
using session_event_callback
 Type for session event callback.
 
using service_handler = storage_query_exec_job::service_handler
 Service handler type.
 

Public Member Functions

 pipeline_adapter ()
 Construct adapter with default configuration.
 
 pipeline_adapter (const pipeline_config &config)
 Construct adapter with custom configuration.
 
 ~pipeline_adapter ()
 Destructor - ensures graceful shutdown.
 
 pipeline_adapter (const pipeline_adapter &)=delete
 
pipeline_adapteroperator= (const pipeline_adapter &)=delete
 
 pipeline_adapter (pipeline_adapter &&)=delete
 
pipeline_adapteroperator= (pipeline_adapter &&)=delete
 
auto start () -> VoidResult
 Start the pipeline adapter.
 
auto stop () -> VoidResult
 Stop the pipeline adapter.
 
auto is_running () const noexcept -> bool
 Check if the adapter is running.
 
void register_session (uint64_t session_id, session_context context)
 Register a new session.
 
void unregister_session (uint64_t session_id)
 Unregister a session.
 
auto get_session (uint64_t session_id) -> std::optional< session_context >
 Get session context.
 
auto get_active_session_count () const noexcept -> size_t
 Get number of active sessions.
 
auto on_data_received (uint64_t session_id, std::vector< uint8_t > data) -> VoidResult
 Handle incoming data from network.
 
void on_connection_closed (uint64_t session_id)
 Handle connection closed event.
 
void register_c_store_handler (service_handler handler)
 Register C-STORE handler.
 
void register_c_find_handler (service_handler handler)
 Register C-FIND handler.
 
void register_c_get_handler (service_handler handler)
 Register C-GET handler.
 
void register_c_move_handler (service_handler handler)
 Register C-MOVE handler.
 
void register_c_echo_handler (service_handler handler)
 Register C-ECHO handler.
 
void set_send_callback (send_callback callback)
 Set the network send callback.
 
void set_association_callback (association_callback callback)
 Set the association event callback.
 
void set_session_event_callback (session_event_callback callback)
 Set the session event callback.
 
auto get_metrics () noexcept -> pipeline_metrics &
 Get the pipeline metrics.
 
auto get_metrics () const noexcept -> const pipeline_metrics &
 Get the pipeline metrics (const)
 
auto get_coordinator () noexcept -> pipeline_coordinator &
 Get the underlying coordinator.
 
auto get_coordinator () const noexcept -> const pipeline_coordinator &
 Get the underlying coordinator (const)
 

Private Member Functions

auto get_handler_for_command (dimse_command_type type) -> service_handler
 Get service handler for command type.
 
void on_job_completed (const job_context &ctx, bool success)
 Handle job completion.
 
void on_backpressure (pipeline_stage stage, size_t queue_depth)
 Handle backpressure.
 

Private Attributes

std::unique_ptr< pipeline_coordinatorcoordinator_
 Pipeline coordinator.
 
std::unordered_map< uint64_t, session_contextsessions_
 Session registry.
 
std::mutex sessions_mutex_
 
service_handler c_store_handler_
 Service handlers.
 
service_handler c_find_handler_
 
service_handler c_get_handler_
 
service_handler c_move_handler_
 
service_handler c_echo_handler_
 
std::mutex handlers_mutex_
 
send_callback send_callback_
 Callbacks.
 
association_callback association_callback_
 
session_event_callback session_event_callback_
 
std::mutex callbacks_mutex_
 

Detailed Description

Adapter for integrating pipeline with DICOM server components.

The adapter provides:

  • Session management for active associations
  • Service handler registration for DIMSE operations
  • Network send/receive callbacks
  • Graceful shutdown coordination

Definition at line 100 of file pipeline_adapter.h.

Member Typedef Documentation

◆ association_callback

Initial value:
std::function<void(uint64_t session_id,
const std::vector<uint8_t>& data)>
pdu_type
PDU (Protocol Data Unit) types as defined in DICOM PS3.8.
Definition pdu_types.h:25

Type for association event callback.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 107 of file pipeline_adapter.h.

◆ send_callback

Initial value:
std::function<VoidResult(uint64_t session_id,
const std::vector<uint8_t>& data)>
kcenon::pacs::VoidResult VoidResult
VoidResult type alias for operations without return value.
Definition association.h:59

Type for network send callback.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 103 of file pipeline_adapter.h.

◆ service_handler

◆ session_event_callback

Initial value:
std::function<void(uint64_t session_id,
const std::string& event)>

Type for session event callback.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 112 of file pipeline_adapter.h.

Constructor & Destructor Documentation

◆ pipeline_adapter() [1/4]

kcenon::pacs::network::pipeline::pipeline_adapter::pipeline_adapter ( )

Construct adapter with default configuration.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 24 of file pipeline_adapter.cpp.

25 : pipeline_adapter(pipeline_config{}) {
26}
pipeline_adapter()
Construct adapter with default configuration.

◆ pipeline_adapter() [2/4]

kcenon::pacs::network::pipeline::pipeline_adapter::pipeline_adapter ( const pipeline_config & config)
explicit

Construct adapter with custom configuration.

Parameters
configPipeline configuration

Definition at line 28 of file pipeline_adapter.cpp.

29 : coordinator_(std::make_unique<pipeline_coordinator>(config)) {
30
31 // Set up internal callbacks
32 coordinator_->set_job_completion_callback(
33 [this](const job_context& ctx, bool success) {
35 }
36 );
37
38 coordinator_->set_backpressure_callback(
39 [this](pipeline_stage stage, size_t depth) {
40 on_backpressure(stage, depth);
41 }
42 );
43}
std::unique_ptr< pipeline_coordinator > coordinator_
Pipeline coordinator.
void on_job_completed(const job_context &ctx, bool success)
Handle job completion.
void on_backpressure(pipeline_stage stage, size_t queue_depth)
Handle backpressure.
pipeline_stage
Identifies the 6 stages of the DICOM I/O pipeline.

References coordinator_, on_backpressure(), on_job_completed(), and kcenon::pacs::network::pipeline::success.

Here is the call graph for this function:

◆ ~pipeline_adapter()

kcenon::pacs::network::pipeline::pipeline_adapter::~pipeline_adapter ( )

Destructor - ensures graceful shutdown.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 45 of file pipeline_adapter.cpp.

45 {
46 if (is_running()) {
47 static_cast<void>(stop());
48 }
49}
auto is_running() const noexcept -> bool
Check if the adapter is running.
auto stop() -> VoidResult
Stop the pipeline adapter.

References is_running(), and stop().

Here is the call graph for this function:

◆ pipeline_adapter() [3/4]

kcenon::pacs::network::pipeline::pipeline_adapter::pipeline_adapter ( const pipeline_adapter & )
delete

◆ pipeline_adapter() [4/4]

kcenon::pacs::network::pipeline::pipeline_adapter::pipeline_adapter ( pipeline_adapter && )
delete

Member Function Documentation

◆ get_active_session_count()

auto kcenon::pacs::network::pipeline::pipeline_adapter::get_active_session_count ( ) const -> size_t
nodiscardnoexcept

Get number of active sessions.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 120 of file pipeline_adapter.cpp.

120 {
121 std::lock_guard<std::mutex> lock(sessions_mutex_);
122 return sessions_.size();
123}
std::unordered_map< uint64_t, session_context > sessions_
Session registry.

References sessions_, and sessions_mutex_.

◆ get_coordinator() [1/2]

auto kcenon::pacs::network::pipeline::pipeline_adapter::get_coordinator ( ) const -> const pipeline_coordinator&
nodiscardnoexcept

Get the underlying coordinator (const)

Definition at line 242 of file pipeline_adapter.cpp.

243 {
244 return *coordinator_;
245}

References coordinator_.

◆ get_coordinator() [2/2]

auto kcenon::pacs::network::pipeline::pipeline_adapter::get_coordinator ( ) -> pipeline_coordinator&
nodiscardnoexcept

Get the underlying coordinator.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 238 of file pipeline_adapter.cpp.

238 {
239 return *coordinator_;
240}

References coordinator_.

◆ get_handler_for_command()

auto kcenon::pacs::network::pipeline::pipeline_adapter::get_handler_for_command ( dimse_command_type type) -> service_handler
nodiscardprivate

Get service handler for command type.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 251 of file pipeline_adapter.cpp.

252 {
253 std::lock_guard<std::mutex> lock(handlers_mutex_);
254
255 switch (type) {
257 return c_store_handler_;
258
260 return c_find_handler_;
261
263 return c_get_handler_;
264
266 return c_move_handler_;
267
269 return c_echo_handler_;
270
271 default:
272 return nullptr;
273 }
274}
service_handler c_store_handler_
Service handlers.

References kcenon::pacs::network::pipeline::c_echo_rq, kcenon::pacs::network::pipeline::c_find_rq, kcenon::pacs::network::pipeline::c_get_rq, kcenon::pacs::network::pipeline::c_move_rq, and kcenon::pacs::network::pipeline::c_store_rq.

◆ get_metrics() [1/2]

auto kcenon::pacs::network::pipeline::pipeline_adapter::get_metrics ( ) const -> const pipeline_metrics&
nodiscardnoexcept

Get the pipeline metrics (const)

Definition at line 234 of file pipeline_adapter.cpp.

234 {
235 return coordinator_->get_metrics();
236}

References coordinator_.

◆ get_metrics() [2/2]

auto kcenon::pacs::network::pipeline::pipeline_adapter::get_metrics ( ) -> pipeline_metrics&
nodiscardnoexcept

Get the pipeline metrics.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 230 of file pipeline_adapter.cpp.

230 {
231 return coordinator_->get_metrics();
232}

References coordinator_.

◆ get_session()

auto kcenon::pacs::network::pipeline::pipeline_adapter::get_session ( uint64_t session_id) -> std::optional<session_context>
nodiscard

Get session context.

Parameters
session_idSession identifier
Returns
Session context if found
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 110 of file pipeline_adapter.cpp.

111 {
112 std::lock_guard<std::mutex> lock(sessions_mutex_);
113 auto it = sessions_.find(session_id);
114 if (it != sessions_.end()) {
115 return it->second;
116 }
117 return std::nullopt;
118}

◆ is_running()

auto kcenon::pacs::network::pipeline::pipeline_adapter::is_running ( ) const -> bool
nodiscardnoexcept

Check if the adapter is running.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 63 of file pipeline_adapter.cpp.

63 {
64 return coordinator_->is_running();
65}

References coordinator_.

Referenced by ~pipeline_adapter().

Here is the caller graph for this function:

◆ on_backpressure()

void kcenon::pacs::network::pipeline::pipeline_adapter::on_backpressure ( pipeline_stage stage,
size_t queue_depth )
private

Handle backpressure.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 295 of file pipeline_adapter.cpp.

295 {
296 // Log backpressure event
297 // In a full implementation, this could trigger adaptive throttling
298 session_event_callback callback;
299 {
300 std::lock_guard<std::mutex> lock(callbacks_mutex_);
301 callback = session_event_callback_;
302 }
303
304 if (callback) {
305 std::string event = "backpressure_" + std::string(get_stage_name(stage)) +
306 "_depth_" + std::to_string(queue_depth);
307 callback(0, event); // session_id 0 for system events
308 }
309}
std::function< void(uint64_t session_id, const std::string &event)> session_event_callback
Type for session event callback.
constexpr auto get_stage_name(pipeline_stage stage) noexcept -> std::string_view
Get the human-readable name of a pipeline stage.

References callbacks_mutex_, kcenon::pacs::network::pipeline::get_stage_name(), and session_event_callback_.

Referenced by pipeline_adapter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_connection_closed()

void kcenon::pacs::network::pipeline::pipeline_adapter::on_connection_closed ( uint64_t session_id)

Handle connection closed event.

Parameters
session_idSession that was closed
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 173 of file pipeline_adapter.cpp.

173 {
174 unregister_session(session_id);
175}
void unregister_session(uint64_t session_id)
Unregister a session.

References unregister_session().

Here is the call graph for this function:

◆ on_data_received()

auto kcenon::pacs::network::pipeline::pipeline_adapter::on_data_received ( uint64_t session_id,
std::vector< uint8_t > data ) -> VoidResult
nodiscard

Handle incoming data from network.

Submits received PDU data to the pipeline for processing.

Parameters
session_idSession that received the data
dataRaw PDU bytes
Returns
VoidResult indicating success or error
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 129 of file pipeline_adapter.cpp.

130 {
131 if (!is_running()) {
132 return pacs_void_error(error_codes::not_initialized,
133 "Pipeline adapter is not running");
134 }
135
136 // Update session activity
137 {
138 std::lock_guard<std::mutex> lock(sessions_mutex_);
139 auto it = sessions_.find(session_id);
140 if (it != sessions_.end()) {
141 it->second.last_activity = std::chrono::steady_clock::now();
142 }
143 }
144
145 // Get send callback for use in jobs
146 send_callback send_fn;
147 {
148 std::lock_guard<std::mutex> lock(callbacks_mutex_);
149 send_fn = send_callback_;
150 }
151
152 // Get association callback
153 association_callback assoc_cb;
154 {
155 std::lock_guard<std::mutex> lock(callbacks_mutex_);
156 assoc_cb = association_callback_;
157 }
158
159 // Create receive job
160 auto job = std::make_unique<receive_network_io_job>(
161 session_id,
162 std::move(data),
163 nullptr, // on_data callback not needed
164 nullptr // on_error callback not needed
165 );
166
167 return coordinator_->submit_to_stage(
169 std::move(job)
170 );
171}
std::function< VoidResult(uint64_t session_id, const std::vector< uint8_t > &data)> send_callback
Type for network send callback.
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.
@ network_receive
Stage 1: Receive raw PDU bytes from network.
VoidResult pacs_void_error(int code, const std::string &message, const std::string &details="")
Create a PACS void error result.
Definition result.h:249

References kcenon::pacs::network::pipeline::network_receive, and kcenon::pacs::pacs_void_error().

Here is the call graph for this function:

◆ on_job_completed()

void kcenon::pacs::network::pipeline::pipeline_adapter::on_job_completed ( const job_context & ctx,
bool success )
private

Handle job completion.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 276 of file pipeline_adapter.cpp.

276 {
277 // Record end-to-end metrics if this is the final stage
278 if (ctx.stage == pipeline_stage::network_send) {
279 auto now = std::chrono::steady_clock::now();
280 auto enqueue_time = std::chrono::steady_clock::time_point(
281 std::chrono::nanoseconds(ctx.enqueue_time_ns)
282 );
283 auto latency_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(
284 now - enqueue_time
285 ).count();
286
287 coordinator_->get_metrics().record_operation_completion(
288 ctx.category,
289 static_cast<uint64_t>(latency_ns),
290 success
291 );
292 }
293}
@ network_send
Stage 6: Send PDU bytes to network.

References kcenon::pacs::network::pipeline::job_context::category, coordinator_, kcenon::pacs::network::pipeline::job_context::enqueue_time_ns, kcenon::pacs::network::pipeline::network_send, kcenon::pacs::network::pipeline::job_context::stage, and kcenon::pacs::network::pipeline::success.

Referenced by pipeline_adapter().

Here is the caller graph for this function:

◆ operator=() [1/2]

pipeline_adapter & kcenon::pacs::network::pipeline::pipeline_adapter::operator= ( const pipeline_adapter & )
delete

◆ operator=() [2/2]

pipeline_adapter & kcenon::pacs::network::pipeline::pipeline_adapter::operator= ( pipeline_adapter && )
delete

◆ register_c_echo_handler()

void kcenon::pacs::network::pipeline::pipeline_adapter::register_c_echo_handler ( service_handler handler)

Register C-ECHO handler.

Parameters
handlerHandler function
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 201 of file pipeline_adapter.cpp.

201 {
202 std::lock_guard<std::mutex> lock(handlers_mutex_);
203 c_echo_handler_ = std::move(handler);
204}

References c_echo_handler_, and handlers_mutex_.

◆ register_c_find_handler()

void kcenon::pacs::network::pipeline::pipeline_adapter::register_c_find_handler ( service_handler handler)

Register C-FIND handler.

Parameters
handlerHandler function
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 186 of file pipeline_adapter.cpp.

186 {
187 std::lock_guard<std::mutex> lock(handlers_mutex_);
188 c_find_handler_ = std::move(handler);
189}

References c_find_handler_, and handlers_mutex_.

◆ register_c_get_handler()

void kcenon::pacs::network::pipeline::pipeline_adapter::register_c_get_handler ( service_handler handler)

Register C-GET handler.

Parameters
handlerHandler function
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 191 of file pipeline_adapter.cpp.

191 {
192 std::lock_guard<std::mutex> lock(handlers_mutex_);
193 c_get_handler_ = std::move(handler);
194}

References c_get_handler_, and handlers_mutex_.

◆ register_c_move_handler()

void kcenon::pacs::network::pipeline::pipeline_adapter::register_c_move_handler ( service_handler handler)

Register C-MOVE handler.

Parameters
handlerHandler function
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 196 of file pipeline_adapter.cpp.

196 {
197 std::lock_guard<std::mutex> lock(handlers_mutex_);
198 c_move_handler_ = std::move(handler);
199}

References c_move_handler_, and handlers_mutex_.

◆ register_c_store_handler()

void kcenon::pacs::network::pipeline::pipeline_adapter::register_c_store_handler ( service_handler handler)

Register C-STORE handler.

Parameters
handlerHandler function
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 181 of file pipeline_adapter.cpp.

181 {
182 std::lock_guard<std::mutex> lock(handlers_mutex_);
183 c_store_handler_ = std::move(handler);
184}

References c_store_handler_, and handlers_mutex_.

◆ register_session()

void kcenon::pacs::network::pipeline::pipeline_adapter::register_session ( uint64_t session_id,
session_context context )

Register a new session.

Parameters
session_idUnique session identifier
contextSession context information
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 71 of file pipeline_adapter.cpp.

72 {
73 std::lock_guard<std::mutex> lock(sessions_mutex_);
74 context.session_id = session_id;
75 context.created_at = std::chrono::steady_clock::now();
76 context.last_activity = context.created_at;
77 sessions_[session_id] = std::move(context);
78
79 // Update metrics
80 coordinator_->get_metrics().increment_active_associations();
81
82 // Notify session event
84 {
85 std::lock_guard<std::mutex> cb_lock(callbacks_mutex_);
86 callback = session_event_callback_;
87 }
88 if (callback) {
89 callback(session_id, "session_registered");
90 }
91}

References callbacks_mutex_, coordinator_, kcenon::pacs::network::pipeline::session_context::created_at, kcenon::pacs::network::pipeline::session_context::last_activity, session_event_callback_, kcenon::pacs::network::pipeline::session_context::session_id, sessions_, and sessions_mutex_.

◆ set_association_callback()

void kcenon::pacs::network::pipeline::pipeline_adapter::set_association_callback ( association_callback callback)

Set the association event callback.

Parameters
callbackFunction to handle association PDUs
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 215 of file pipeline_adapter.cpp.

215 {
216 std::lock_guard<std::mutex> lock(callbacks_mutex_);
217 association_callback_ = std::move(callback);
218}

References association_callback_, and callbacks_mutex_.

◆ set_send_callback()

void kcenon::pacs::network::pipeline::pipeline_adapter::set_send_callback ( send_callback callback)

Set the network send callback.

Parameters
callbackFunction to send data over network
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 210 of file pipeline_adapter.cpp.

210 {
211 std::lock_guard<std::mutex> lock(callbacks_mutex_);
212 send_callback_ = std::move(callback);
213}

References callbacks_mutex_, and send_callback_.

◆ set_session_event_callback()

void kcenon::pacs::network::pipeline::pipeline_adapter::set_session_event_callback ( session_event_callback callback)

Set the session event callback.

Parameters
callbackFunction to handle session events
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 220 of file pipeline_adapter.cpp.

221 {
222 std::lock_guard<std::mutex> lock(callbacks_mutex_);
223 session_event_callback_ = std::move(callback);
224}

References callbacks_mutex_, and session_event_callback_.

◆ start()

auto kcenon::pacs::network::pipeline::pipeline_adapter::start ( ) -> VoidResult
nodiscard

Start the pipeline adapter.

Returns
VoidResult indicating success or error
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 55 of file pipeline_adapter.cpp.

55 {
56 return coordinator_->start();
57}

◆ stop()

auto kcenon::pacs::network::pipeline::pipeline_adapter::stop ( ) -> VoidResult
nodiscard

Stop the pipeline adapter.

Returns
VoidResult indicating success or error
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 59 of file pipeline_adapter.cpp.

59 {
60 return coordinator_->stop();
61}

Referenced by ~pipeline_adapter().

Here is the caller graph for this function:

◆ unregister_session()

void kcenon::pacs::network::pipeline::pipeline_adapter::unregister_session ( uint64_t session_id)

Unregister a session.

Parameters
session_idSession to unregister
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/network/pipeline/pipeline_adapter.h.

Definition at line 93 of file pipeline_adapter.cpp.

93 {
94 std::lock_guard<std::mutex> lock(sessions_mutex_);
95 if (sessions_.erase(session_id) > 0) {
96 coordinator_->get_metrics().decrement_active_associations();
97
98 // Notify session event
100 {
101 std::lock_guard<std::mutex> cb_lock(callbacks_mutex_);
102 callback = session_event_callback_;
103 }
104 if (callback) {
105 callback(session_id, "session_unregistered");
106 }
107 }
108}

References callbacks_mutex_, coordinator_, session_event_callback_, sessions_, and sessions_mutex_.

Referenced by on_connection_closed().

Here is the caller graph for this function:

Member Data Documentation

◆ association_callback_

association_callback kcenon::pacs::network::pipeline::pipeline_adapter::association_callback_
private

◆ c_echo_handler_

service_handler kcenon::pacs::network::pipeline::pipeline_adapter::c_echo_handler_
private

◆ c_find_handler_

service_handler kcenon::pacs::network::pipeline::pipeline_adapter::c_find_handler_
private

◆ c_get_handler_

service_handler kcenon::pacs::network::pipeline::pipeline_adapter::c_get_handler_
private

◆ c_move_handler_

service_handler kcenon::pacs::network::pipeline::pipeline_adapter::c_move_handler_
private

◆ c_store_handler_

service_handler kcenon::pacs::network::pipeline::pipeline_adapter::c_store_handler_
private

◆ callbacks_mutex_

std::mutex kcenon::pacs::network::pipeline::pipeline_adapter::callbacks_mutex_
mutableprivate

◆ coordinator_

◆ handlers_mutex_

std::mutex kcenon::pacs::network::pipeline::pipeline_adapter::handlers_mutex_
mutableprivate

◆ send_callback_

send_callback kcenon::pacs::network::pipeline::pipeline_adapter::send_callback_
private

◆ session_event_callback_

session_event_callback kcenon::pacs::network::pipeline::pipeline_adapter::session_event_callback_
private

◆ sessions_

std::unordered_map<uint64_t, session_context> kcenon::pacs::network::pipeline::pipeline_adapter::sessions_
private

◆ sessions_mutex_

std::mutex kcenon::pacs::network::pipeline::pipeline_adapter::sessions_mutex_
mutableprivate

The documentation for this class was generated from the following files: