22 std::unique_lock lock(mutex_);
23 auto key =
key_type{std::string{creator_id}, definition.element_offset};
24 auto [it, inserted] = definitions_.try_emplace(std::move(key), definition);
29 std::string_view creator_id,
30 std::span<const private_tag_definition> definitions) ->
size_t {
31 std::unique_lock lock(mutex_);
34 for (
const auto& def : definitions) {
35 auto key =
key_type{std::string{creator_id}, def.element_offset};
36 auto [it, inserted] = definitions_.try_emplace(std::move(key), def);
46 uint8_t element_offset)
const
47 -> std::optional<private_tag_definition> {
48 std::shared_lock lock(mutex_);
49 auto key =
key_type{std::string{creator_id}, element_offset};
50 auto it = definitions_.find(key);
51 if (it == definitions_.end()) {
58 std::shared_lock lock(
mutex_);
63 std::unique_lock lock(
mutex_);
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.
std::pair< std::string, uint8_t > key_type
Key type: (creator_id, element_offset)
std::shared_mutex mutex_
Mutex for thread-safe access.
Registry of vendor-specific private tag definitions.
Definition of a vendor-specific private tag.