For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
  • Introduction
    • Overview
    • Relevant Technologies
    • Getting Started
  • Setup
    • SDK Installation
    • Additional Setup
    • Third Party Hardware Setup
  • Using the SDK
    • Holoscan Core
    • GPU Resident Execution
    • Holoscan by Example
    • Create an Application
    • Create a Distributed Application
    • Create an Operator
    • Create an Operator via Decorator
    • Create a Condition
    • Dynamic Flow Control
    • CUDA Stream Handling
    • Logging
    • Data Logging
    • Debugging
    • Python Operator Bindings
  • Operators
    • Operators and Extensions
    • Visualization
    • Inference
    • Testing
    • Video I/O Vendor Implementation Guide
  • Components
    • Schedulers
    • Conditions
    • Resources
    • Analytics
  • AI Skills
    • Ai Skills
  • API reference
              • HashMap
  • Performance
    • Performance Considerations
    • Flow Tracking
    • GXF Job Statistics
    • Nsight Profiling
  • HoloHub
    • HoloHub Overview
  • FAQ
    • FAQ
NVIDIANVIDIA
Developer-friendly docs for your API
Privacy Policy | Your Privacy Choices | Terms of Service | Accessibility | Corporate Policies | Product Security | Contact

Copyright © 2026, NVIDIA Corporation.

LogoLogoDocumentation
On this page
  • Constructors
  • HashMap
  • Methods
  • initialize
  • has
  • get
  • try_get
  • insert
  • erase
  • size
  • capacity
  • insert_impl
  • fill_holes
  • get_index
  • Types
  • Typedefs
  • Error
  • Member variables
  • Inner classes
  • Entry
API referenceC++ APIHoloscanNamespacesPose TreeClasses

holoscan::pose_tree::HashMap

Beta
||View as Markdown|
Previous

holoscan::ops::BufferInfo

Next

holoscan::pose_tree_math::interpolate

template <typename Key, typename Value>
class HashMap

A hash map implementation using open addressing with linear probing.

This class provides a fixed-capacity hash map that uses pre-allocated memory and linear probing for collision resolution. It supports basic operations like insert, get, erase, and has. The hash map is designed for performance-critical scenarios where memory allocation should be minimized.

#include <holoscan/pose_tree/hash_map.hpp>

Template parameters

Key
typename

The key type for the hash map.

Value
typename

The value type for the hash map.


Constructors

HashMap

holoscan::pose_tree::HashMap<Key, Value>::HashMap() = defaultholoscan::pose_tree::HashMap<Key, Value>::HashMap() = default

Default constructor used to be able to pre-allocate memory.


Methods

initialize

expected_t<void> holoscan::pose_tree::HashMap<Key, Value>::initialize(
int32_t size,
int32_t capacity
)

Reserve memory for the hash map.

Returns: Success or error status.

Parameters

size
int32_t

Maximum number of elements the hash map can store.

capacity
int32_t

Total capacity of the internal array (should be larger than size for efficiency).

has

bool holoscan::pose_tree::HashMap<Key, Value>::has(
const Key &key
) const

Check if a key exists in the hash map.

Returns: True if the key exists, false otherwise.

Parameters

key
const Key &

The key to search for.

get

expected_t<Value> holoscan::pose_tree::HashMap<Key, Value>::get(
const Key &key
) const

Get the value associated with a key.

Returns: Value associated with the key on success, Error::kKeyNotFound if key doesn’t exist.

Parameters

key
const Key &

The key to search for.

try_get

Mutable
Const
expected_t<Value *> holoscan::pose_tree::HashMap<Key, Value>::try_get(
const Key &key
)

Try to get the value ptr associated with a key.

Returns: Value associated with the key on success, Error::kKeyNotFound if key doesn’t exist.

Parameters

key
const Key &

The key to search for.

insert

Single element (1)
Single element (2)
expected_t<Value *> holoscan::pose_tree::HashMap<Key, Value>::insert(
const Key &key,
const Value &value
)

Insert a key-value pair into the hash map.

Returns: Success or error status. Error::kHashMapFull if the map is full, Error::kKeyAlreadyExists if the key already exists.

Parameters

key
const Key &

The key to insert.

value
const Value &

The value to associate with the key.

erase

expected_t<void> holoscan::pose_tree::HashMap<Key, Value>::erase(
const Key &key
)

Remove a key-value pair from the hash map.

Returns: Success or error status. Error::kKeyNotFound if the key doesn’t exist.

Parameters

key
const Key &

The key to remove.

size

int32_t holoscan::pose_tree::HashMap<Key, Value>::size() const

Get the current number of elements in the hash map.

Returns: Current size of the hash map.

capacity

int32_t holoscan::pose_tree::HashMap<Key, Value>::capacity() const

Get the capacity of the hash map.

Returns: Max capacity of the hash map.

insert_impl

template <typename ValueType>
expected_t<Value *> holoscan::pose_tree::HashMap<Key, Value>::insert_impl(
const Key &key,
ValueType &&value
)

Internal implementation for inserting key-value pairs.

Returns: Success or error status.

Parameters

key
const Key &

The key to insert.

value
ValueType &&

The value to associate with the key.

fill_holes

void holoscan::pose_tree::HashMap<Key, Value>::fill_holes(
int index
)

Fill holes in the hash table after deletion to maintain linear probing invariants.

This method is called after an element is deleted to ensure that subsequent lookups continue to work correctly with linear probing.

Parameters

index
int

The index where a deletion occurred.

get_index

expected_t<int32_t> holoscan::pose_tree::HashMap<Key, Value>::get_index(
const Key &key
) const

Get the index where the key is.

Returns: The index associated with the key on success, Error::kKeyNotFound if key doesn’t exist.

Parameters

key
const Key &

The key to search for.


Types

Typedefs

NameDefinitionDescription
expected_texpected< T, Error >Expected type used by this class.
unexpected_tunexpected< Error >Unexpected type used by this class.
hash_tuint64_tHash type used internally.

Error

Error codes used by this class.

NameValueDescription
kInvalidArgumentkInvalidArgument is returned when a function is called with argument that does not make sense such as negative size or capacity smaller than size.
kOutOfMemorykOutOfMemory is returned when a memory allocation fails.
kHashMapFullkHashMapFull is returned if the hash map is full.
kKeyNotFoundkKeyNotFound is returned if the key is not found in the hash map.
kKeyAlreadyExistskKeyAlreadyExists is returned if the key already exists in the hash map.

Member variables

NameTypeDescription
entries_std::unique_ptr< Entry[]>Array of entries in the hash map.
size_int32_tCurrent number of elements in the hash map.
max_size_int32_tMaximum number of elements the hash map can store.
capacity_int32_tTotal capacity of the internal array.

Inner classes

Entry

struct holoscan::pose_tree::HashMap::Entry

Internal structure representing an entry in the hash map.

NameTypeDescription
hashhash_tHash value of the key.
keyKeyThe key.
is_occupiedboolWhether this entry is occupied.
valueValueThe value associated with the key.