BioDynaMo  v1.05.119-a4ff3934
Classes | Public Member Functions | Private Attributes | List of all members
bdm::AgentUidMap< TValue > Class Template Reference

#include <agent_uid_map.h>

Classes

struct  Iterator
 

Public Member Functions

 AgentUidMap ()=default
 
 AgentUidMap (const AgentUidMap &other)
 
 AgentUidMap (uint64_t initial_size)
 
void resize (uint64_t new_size)
 
void clear ()
 
void ParallelClear ()
 
uint64_t size () const
 
void Remove (const AgentUid &key)
 
bool Contains (const AgentUid &uid) const
 
void Insert (const AgentUid &uid, const TValue &value)
 
const TValue & operator[] (const AgentUid &key) const
 
AgentUid::Reused_t GetReused (uint64_t index) const
 

Private Attributes

std::vector< TValue > data_
 
std::vector< typename AgentUid::Reused_tagent_uid_reused_
 

Detailed Description

template<typename TValue>
class bdm::AgentUidMap< TValue >

AgentUidMap is an associative container that exploits the properties of AgentUid to store data in contiguous arrays. Inserting elements and reading elements at the same time is thread-safe as long as the keys are different. These operations with distinct keys are lock-free and atomic free, and thus offer high-performance.

Definition at line 31 of file agent_uid_map.h.

Constructor & Destructor Documentation

◆ AgentUidMap() [1/3]

template<typename TValue >
bdm::AgentUidMap< TValue >::AgentUidMap ( )
default

◆ AgentUidMap() [2/3]

template<typename TValue >
bdm::AgentUidMap< TValue >::AgentUidMap ( const AgentUidMap< TValue > &  other)
inline

Definition at line 40 of file agent_uid_map.h.

◆ AgentUidMap() [3/3]

template<typename TValue >
bdm::AgentUidMap< TValue >::AgentUidMap ( uint64_t  initial_size)
inlineexplicit

Definition at line 43 of file agent_uid_map.h.

Member Function Documentation

◆ clear()

template<typename TValue >
void bdm::AgentUidMap< TValue >::clear ( )
inline

Definition at line 53 of file agent_uid_map.h.

◆ Contains()

template<typename TValue >
bool bdm::AgentUidMap< TValue >::Contains ( const AgentUid uid) const
inline

Definition at line 77 of file agent_uid_map.h.

◆ GetReused()

template<typename TValue >
AgentUid::Reused_t bdm::AgentUidMap< TValue >::GetReused ( uint64_t  index) const
inline

Definition at line 95 of file agent_uid_map.h.

◆ Insert()

template<typename TValue >
void bdm::AgentUidMap< TValue >::Insert ( const AgentUid uid,
const TValue &  value 
)
inline

Definition at line 85 of file agent_uid_map.h.

◆ operator[]()

template<typename TValue >
const TValue& bdm::AgentUidMap< TValue >::operator[] ( const AgentUid key) const
inline

Definition at line 91 of file agent_uid_map.h.

◆ ParallelClear()

template<typename TValue >
void bdm::AgentUidMap< TValue >::ParallelClear ( )
inline

Definition at line 59 of file agent_uid_map.h.

◆ Remove()

template<typename TValue >
void bdm::AgentUidMap< TValue >::Remove ( const AgentUid key)
inline

Definition at line 70 of file agent_uid_map.h.

◆ resize()

template<typename TValue >
void bdm::AgentUidMap< TValue >::resize ( uint64_t  new_size)
inline

Definition at line 48 of file agent_uid_map.h.

◆ size()

template<typename TValue >
uint64_t bdm::AgentUidMap< TValue >::size ( ) const
inline

Definition at line 66 of file agent_uid_map.h.

Member Data Documentation

◆ agent_uid_reused_

template<typename TValue >
std::vector<typename AgentUid::Reused_t> bdm::AgentUidMap< TValue >::agent_uid_reused_
private

Definition at line 101 of file agent_uid_map.h.

◆ data_

template<typename TValue >
std::vector<TValue> bdm::AgentUidMap< TValue >::data_
private

Definition at line 100 of file agent_uid_map.h.


The documentation for this class was generated from the following file: