#include <TagBitRegistry.h>
Inherits AZStd::intrusive_base.
Public Types | |
using | TagType = Handle< IndexType > |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (TagBitRegistry, AZ::SystemAllocator) | |
AZ_DISABLE_COPY_MOVE (TagBitRegistry) | |
void | Reset () |
Resets the registry back to an empty state. All references are released. | |
TagType | AcquireTag (const Name &tagName) |
void | ReleaseTag (TagType tagName) |
TagType | FindTag (const Name &tagName) const |
Name | GetName (TagType tag) const |
Returns the name of the given tag, or empty string if the tag is not registered. | |
size_t | GetAllocatedTagCount () const |
Returns the number of allocated tags in the registry. | |
template<class TagVisitor > | |
void | VisitTags (TagVisitor visitor) |
Static Public Member Functions | |
static Ptr< TagBitRegistry > | Create () |
A variant of TagRegistry that stores bit masks directly. The maximum number of tags is inferred from the number of bits available in TagType. Tags will always have a single bit flipped to 1. See TagRegistry for more details.
auto AZ::RHI::TagBitRegistry< IndexType >::AcquireTag | ( | const Name & | tagName | ) |
Acquires a tag from the provided name (case sensitive). If the tag already existed, it is ref-counted. Returns a valid tag on success; returns a null tag if the registry is at full capacity. You must call ReleaseTag() if successful.
auto AZ::RHI::TagBitRegistry< IndexType >::FindTag | ( | const Name & | tagName | ) | const |
Finds the tag associated with the provided name (case sensitive). If a tag exists with that name, the tag is returned. The reference count is NOT incremented on success; ownership is not passed to the user. If the tag does not exist, a null tag is returned.
void AZ::RHI::TagBitRegistry< IndexType >::ReleaseTag | ( | TagType | tagName | ) |
Releases a reference to a tag. Tags are ref-counted, so it's necessary to maintain ownership of the tag and release when its no longer needed.