BioDynaMo
v1.05.120-25dc9790
|
#include <agent_pointer.h>
Classes | |
union | Data |
TODO. Replace with std::variant once we move to >= c++17. More... | |
Public Member Functions | |
AgentPointer (const AgentUid &uid) | |
AgentPointer (TAgent *agent) | |
AgentPointer (std::nullptr_t) | |
Allow AgentPointer<> ap = nullptr definitions. More... | |
AgentPointer () | |
constructs an AgentPointer object representing a nullptr More... | |
~AgentPointer ()=default | |
uint64_t | GetUidAsUint64 () const |
AgentUid | GetUid () const |
bool | operator== (std::nullptr_t) const |
bool | operator!= (std::nullptr_t) const |
bool | operator== (const AgentPointer &other) const |
bool | operator!= (const AgentPointer &other) const |
template<typename TOtherAgent > | |
bool | operator== (const TOtherAgent *other) const |
template<typename TOtherAgent > | |
bool | operator!= (const TOtherAgent *other) const |
AgentPointer & | operator= (std::nullptr_t) |
TAgent * | operator-> () |
const TAgent * | operator-> () const |
TAgent & | operator* () |
const TAgent & | operator* () const |
operator bool () const | |
operator AgentPointer< Agent > () const | |
TAgent * | Get () |
const TAgent * | Get () const |
bool | operator< (const AgentPointer &other) const |
Private Member Functions | |
template<typename TFrom , typename TTo > | |
std::enable_if< std::is_base_of< TFrom, TTo >::value, TTo * >::type | Cast (TFrom *agent) const |
template<typename TFrom , typename TTo > | |
std::enable_if<!std::is_base_of< TFrom, TTo >::value, TTo * >::type | Cast (TFrom *agent) const |
BDM_CLASS_DEF_NV (AgentPointer, 3) | |
Private Attributes | |
Data | d_ = {AgentUid()} |
Friends | |
std::ostream & | operator<< (std::ostream &str, const AgentPointer &agent_ptr) |
Agent pointer. Required to point to an agent throughout the whole simulation.
This class provides a common interface for different modes. See AgentPointerMode
for more details. Benefit compared to AgentHandle is, that the compiler knows the type returned by Get
and can therefore inline the code from the callee and perform optimizations.
TAgent | agent type |
Definition at line 58 of file agent_pointer.h.
|
inlineexplicit |
Definition at line 60 of file agent_pointer.h.
|
inlineexplicit |
Definition at line 72 of file agent_pointer.h.
|
inline |
Allow AgentPointer<> ap = nullptr
definitions.
Definition at line 84 of file agent_pointer.h.
|
inline |
constructs an AgentPointer object representing a nullptr
Definition at line 87 of file agent_pointer.h.
|
default |
|
private |
|
inlineprivate |
Definition at line 246 of file agent_pointer.h.
|
inlineprivate |
Definition at line 252 of file agent_pointer.h.
|
inline |
Definition at line 224 of file agent_pointer.h.
|
inline |
Definition at line 226 of file agent_pointer.h.
|
inline |
Definition at line 102 of file agent_pointer.h.
|
inline |
Definition at line 91 of file agent_pointer.h.
|
inline |
Definition at line 216 of file agent_pointer.h.
|
inline |
Definition at line 214 of file agent_pointer.h.
|
inline |
Definition at line 135 of file agent_pointer.h.
|
inline |
Definition at line 163 of file agent_pointer.h.
|
inline |
Not equal operator that enables the following statement agent_ptr != nullptr;
Definition at line 125 of file agent_pointer.h.
|
inline |
Definition at line 210 of file agent_pointer.h.
|
inline |
Definition at line 212 of file agent_pointer.h.
|
inline |
Definition at line 178 of file agent_pointer.h.
|
inline |
Definition at line 191 of file agent_pointer.h.
|
inline |
Definition at line 228 of file agent_pointer.h.
|
inline |
Assignment operator that changes the internal representation to nullptr. Makes the following statement possible agent_ptr = nullptr;
Definition at line 169 of file agent_pointer.h.
|
inline |
Definition at line 127 of file agent_pointer.h.
|
inline |
Definition at line 144 of file agent_pointer.h.
|
inline |
Equals operator that enables the following statement agent_ptr == nullptr;
Definition at line 115 of file agent_pointer.h.
|
friend |
Definition at line 204 of file agent_pointer.h.
|
private |
Definition at line 243 of file agent_pointer.h.