|
ORE Studio 0.0.4
|
Shared cache mapping host UUID strings to whimsical display names. More...
#include <HostDisplayNameCache.hpp>
Inherits QObject.

Public Member Functions | |
| HostDisplayNameCache (QObject *parent=nullptr) | |
| QString | display_name_for (const QString &uuid) const |
| Returns the display name for the given UUID string. | |
| void | populate_from (const std::vector< compute::domain::host > &hosts) |
| Populates (or updates) the cache from a list of hosts. | |
| void | clear () |
| Removes all entries from the cache. | |
Shared cache mapping host UUID strings to whimsical display names.
Avoids repeated list-hosts requests by centralising the UUID → name mapping. All client models that need to render host names hold a pointer to the single instance owned by the controller.
If a UUID is not present in the cache, display_name_for() returns the first 8 characters of the UUID as a short-ID fallback.
| QString display_name_for | ( | const QString & | uuid | ) | const |
Returns the display name for the given UUID string.
Falls back to the first 8 characters of the UUID when the cache has no entry (e.g., the host was registered after the last refresh).
| void populate_from | ( | const std::vector< compute::domain::host > & | hosts | ) |
Populates (or updates) the cache from a list of hosts.
Existing entries are overwritten if the host appears in hosts. Entries for hosts not present in hosts are kept (no eviction).