This class generates unique ids for agents.
More...
#include <agent_uid_generator.h>
This class generates unique ids for agents.
Definition at line 33 of file agent_uid_generator.h.
◆ AgentUidGenerator() [1/2]
◆ AgentUidGenerator() [2/2]
bdm::AgentUidGenerator::AgentUidGenerator |
( |
| ) |
|
|
inline |
◆ BDM_CLASS_DEF_NV()
◆ GenerateUid()
AgentUid bdm::AgentUidGenerator::GenerateUid |
( |
| ) |
|
|
inline |
Generates AgentUid with increasing index. In defragmentation mode it reuses index values from removed agents and increments the reused field. Thread-safe.
Definition at line 44 of file agent_uid_generator.h.
◆ GetHighestIndex()
◆ ReuseAgentUid()
void bdm::AgentUidGenerator::ReuseAgentUid |
( |
const AgentUid & |
uid | ) |
|
|
inline |
◆ Update()
void bdm::AgentUidGenerator::Update |
( |
| ) |
|
|
inline |
Resizes internal data structures to the number of threads. NB: If Update is called, calls to GenerateUid or ReuseAgentUid are not allowed!
Definition at line 67 of file agent_uid_generator.h.
◆ counter_
◆ root_counter_
ROOT can't persist std::atomic. Therefore this additional helper variable is needed.
Definition at line 73 of file agent_uid_generator.h.
◆ tinfo_
ThreadInfo* bdm::AgentUidGenerator::tinfo_ = nullptr |
|
private |
◆ tl_uids_
The documentation for this class was generated from the following file: