PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::workflow::lock_info Struct Reference

Detailed information about a lock on a study. More...

#include <study_lock_manager.h>

Collaboration diagram for kcenon::pacs::workflow::lock_info:
Collaboration graph

Public Member Functions

auto duration () const -> std::chrono::milliseconds
 Get lock duration.
 
auto is_expired () const -> bool
 Check if the lock has expired.
 

Public Attributes

std::string study_uid
 Study UID that is locked.
 
lock_type type {lock_type::exclusive}
 Type of lock held.
 
std::string reason
 Reason for the lock.
 
std::string holder
 Who holds the lock (user/service identifier)
 
std::string token_id
 Lock token ID.
 
std::chrono::system_clock::time_point acquired_at
 When the lock was acquired.
 
std::optional< std::chrono::system_clock::time_point > expires_at
 When the lock expires (if timeout set)
 
std::size_t shared_count {0}
 Number of shared lock holders (for shared locks)
 

Detailed Description

Detailed information about a lock on a study.

Definition at line 132 of file study_lock_manager.h.

Member Function Documentation

◆ duration()

auto kcenon::pacs::workflow::lock_info::duration ( ) const -> std::chrono::milliseconds
inlinenodiscard

Get lock duration.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/workflow/study_lock_manager.h.

Definition at line 160 of file study_lock_manager.h.

160 {
161 return std::chrono::duration_cast<std::chrono::milliseconds>(
162 std::chrono::system_clock::now() - acquired_at);
163 }
std::chrono::system_clock::time_point acquired_at
When the lock was acquired.

References acquired_at.

◆ is_expired()

auto kcenon::pacs::workflow::lock_info::is_expired ( ) const -> bool
inlinenodiscard

Check if the lock has expired.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/workflow/study_lock_manager.h.

Definition at line 168 of file study_lock_manager.h.

168 {
169 if (!expires_at) return false;
170 return std::chrono::system_clock::now() >= *expires_at;
171 }
std::optional< std::chrono::system_clock::time_point > expires_at
When the lock expires (if timeout set)

References expires_at.

Member Data Documentation

◆ acquired_at

std::chrono::system_clock::time_point kcenon::pacs::workflow::lock_info::acquired_at

◆ expires_at

std::optional<std::chrono::system_clock::time_point> kcenon::pacs::workflow::lock_info::expires_at

◆ holder

std::string kcenon::pacs::workflow::lock_info::holder

◆ reason

std::string kcenon::pacs::workflow::lock_info::reason

◆ shared_count

std::size_t kcenon::pacs::workflow::lock_info::shared_count {0}

Number of shared lock holders (for shared locks)

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/workflow/study_lock_manager.h.

Definition at line 155 of file study_lock_manager.h.

155{0};

Referenced by kcenon::pacs::workflow::study_lock_manager::lock().

◆ study_uid

std::string kcenon::pacs::workflow::lock_info::study_uid

◆ token_id

std::string kcenon::pacs::workflow::lock_info::token_id

◆ type

lock_type kcenon::pacs::workflow::lock_info::type {lock_type::exclusive}

The documentation for this struct was generated from the following file: