BioDynaMo  v1.03.58-27764645
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
bdm::AgentHandle Class Reference

#include <agent_handle.h>

Public Types

using NumaNode_t = uint16_t
 
using ElementIdx_t = uint32_t
 

Public Member Functions

constexpr AgentHandle () noexcept
 
 AgentHandle (ElementIdx_t element_idx)
 
 AgentHandle (NumaNode_t numa_node, ElementIdx_t element_idx)
 
NumaNode_t GetNumaNode () const
 
ElementIdx_t GetElementIdx () const
 
void SetElementIdx (ElementIdx_t element_idx)
 
bool operator== (const AgentHandle &other) const
 
bool operator!= (const AgentHandle &other) const
 
bool operator< (const AgentHandle &other) const
 

Private Member Functions

 BDM_CLASS_DEF_NV (AgentHandle, 1)
 

Private Attributes

NumaNode_t numa_node_
 
ElementIdx_t element_idx_
 

Friends

std::ostream & operator<< (std::ostream &stream, const AgentHandle &handle)
 

Detailed Description

Unique identifier of an agent. Acts as a type erased pointer. Has the same type for every agent.
Points to the storage location of an agent inside ResourceManager.
The id is split into two parts: Numa node, element index. The first one is used to obtain the numa storage, and the second specifies the element within this vector.

Definition at line 29 of file agent_handle.h.

Member Typedef Documentation

◆ ElementIdx_t

Definition at line 32 of file agent_handle.h.

◆ NumaNode_t

using bdm::AgentHandle::NumaNode_t = uint16_t

Definition at line 31 of file agent_handle.h.

Constructor & Destructor Documentation

◆ AgentHandle() [1/3]

constexpr bdm::AgentHandle::AgentHandle ( )
inlineconstexprnoexcept

Definition at line 34 of file agent_handle.h.

◆ AgentHandle() [2/3]

bdm::AgentHandle::AgentHandle ( ElementIdx_t  element_idx)
inlineexplicit

Definition at line 38 of file agent_handle.h.

◆ AgentHandle() [3/3]

bdm::AgentHandle::AgentHandle ( NumaNode_t  numa_node,
ElementIdx_t  element_idx 
)
inline

Definition at line 41 of file agent_handle.h.

Member Function Documentation

◆ BDM_CLASS_DEF_NV()

bdm::AgentHandle::BDM_CLASS_DEF_NV ( AgentHandle  ,
 
)
private

◆ GetElementIdx()

ElementIdx_t bdm::AgentHandle::GetElementIdx ( ) const
inline

Definition at line 45 of file agent_handle.h.

◆ GetNumaNode()

NumaNode_t bdm::AgentHandle::GetNumaNode ( ) const
inline

Definition at line 44 of file agent_handle.h.

◆ operator!=()

bool bdm::AgentHandle::operator!= ( const AgentHandle other) const
inline

Definition at line 52 of file agent_handle.h.

◆ operator<()

bool bdm::AgentHandle::operator< ( const AgentHandle other) const
inline

Definition at line 54 of file agent_handle.h.

◆ operator==()

bool bdm::AgentHandle::operator== ( const AgentHandle other) const
inline

Definition at line 48 of file agent_handle.h.

◆ SetElementIdx()

void bdm::AgentHandle::SetElementIdx ( ElementIdx_t  element_idx)
inline

Definition at line 46 of file agent_handle.h.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  stream,
const AgentHandle handle 
)
friend

Definition at line 62 of file agent_handle.h.

Member Data Documentation

◆ element_idx_

ElementIdx_t bdm::AgentHandle::element_idx_
private

changed element index to uint32_t after issues with std::atomic with size 16 -> max element_idx: 4.294.967.296

Definition at line 74 of file agent_handle.h.

◆ numa_node_

NumaNode_t bdm::AgentHandle::numa_node_
private

Definition at line 70 of file agent_handle.h.


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