Bucket#

Fully qualified name: omni::isaac::dynamic_control::Bucket

template<class T>
class Bucket#

A container for managing objects with unique IDs.

Provides a way to store, retrieve, and remove objects using unique IDs. Takes ownership of the objects and manages their lifetime.

Template Parameters:

T – The type of objects stored in the bucket

Public Functions

inline uint32_t add(std::unique_ptr<T> &&obj)#

Adds an object to the bucket.

Takes ownership of the object and assigns it a unique ID

Parameters:

obj[in] The object to add, transferred as an rvalue reference

Returns:

The unique ID assigned to the object

inline T *get(uint32_t id) const#

Gets an object by its ID.

Returns a pointer to the object if found, or nullptr if not found

Parameters:

id[in] The ID of the object to retrieve

Returns:

Pointer to the object, or nullptr if not found

inline void remove(uint32_t id)#

Removes an object by its ID.

If the object is found, it is removed and destroyed

Parameters:

id[in] The ID of the object to remove

inline void clear()#

Clears all objects from the bucket.

Removes and destroys all objects