PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
private_tag_registry.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
18#pragma once
19
21
22#include <cstdint>
23#include <map>
24#include <mutex>
25#include <optional>
26#include <shared_mutex>
27#include <span>
28#include <string>
29#include <string_view>
30#include <vector>
31
32namespace kcenon::pacs::core {
33
46
72public:
77 [[nodiscard]] static auto instance() -> private_tag_registry&;
78
79 // Non-copyable and non-movable (singleton)
84
91 auto register_tag(std::string_view creator_id,
92 const private_tag_definition& definition) -> bool;
93
100 auto register_vendor(std::string_view creator_id,
101 std::span<const private_tag_definition> definitions)
102 -> size_t;
103
110 [[nodiscard]] auto find(std::string_view creator_id,
111 uint8_t element_offset) const
112 -> std::optional<private_tag_definition>;
113
118 [[nodiscard]] auto size() const -> size_t;
119
125 void clear();
126
127private:
129
131 using key_type = std::pair<std::string, uint8_t>;
132
135
137 mutable std::shared_mutex mutex_;
138};
139
140} // namespace kcenon::pacs::core
141
private_tag_registry(const private_tag_registry &)=delete
private_tag_registry(private_tag_registry &&)=delete
std::map< key_type, private_tag_definition > definitions_
Storage for registered definitions.
auto register_vendor(std::string_view creator_id, std::span< const private_tag_definition > definitions) -> size_t
Register a complete vendor dictionary (batch registration)
void clear()
Clear all registered definitions.
auto find(std::string_view creator_id, uint8_t element_offset) const -> std::optional< private_tag_definition >
Look up a private tag definition by creator ID and element offset.
auto register_tag(std::string_view creator_id, const private_tag_definition &definition) -> bool
Register a single vendor-specific private tag definition.
static auto instance() -> private_tag_registry &
Get the singleton instance.
auto size() const -> size_t
Get the number of registered definitions.
auto operator=(private_tag_registry &&) -> private_tag_registry &=delete
std::pair< std::string, uint8_t > key_type
Key type: (creator_id, element_offset)
auto operator=(const private_tag_registry &) -> private_tag_registry &=delete
std::shared_mutex mutex_
Mutex for thread-safe access.
vr_type
DICOM Value Representation (VR) types.
Definition vr_type.h:29
Definition of a vendor-specific private tag.
encoding::vr_type vr
Value Representation.
uint8_t element_offset
Offset within the private block (0x00-0xFF)