#include <TagRegistry.h>
Inherits AZStd::intrusive_base.
Public Types | |
| using | TagType = Handle< IndexType > |
Public Member Functions | |
| AZ_CLASS_ALLOCATOR (TagRegistry, AZ::SystemAllocator) | |
| AZ_DISABLE_COPY_MOVE (TagRegistry) | |
| 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< TagRegistry > | Create () |
Friends | |
| template<typename > | |
| class | TagBitRegistry |
Allocates and registers tags by name, allowing the user to acquire and find tags from names. The class is designed to map user-friendly tag names defined through content or higher level code to low-level tags, which are simple handles.
Some notes about usage and design:
| auto AZ::RHI::TagRegistry< IndexType, MaxTagCount >::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::TagRegistry< IndexType, MaxTagCount >::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::TagRegistry< IndexType, MaxTagCount >::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.