BioDynaMo  v1.05.0-137fdb15
Classes | Public Member Functions | Public Attributes | List of all members
bdm::UniformGridEnvironment::Box Struct Reference

A single unit cube of the grid. More...

#include <uniform_grid_environment.h>

Collaboration diagram for bdm::UniformGridEnvironment::Box:


struct  Iterator
 An iterator that iterates over the cells in this box. More...

Public Member Functions

 Box ()
 Box (const Box &other)
Boxoperator= (const Box &other)
bool IsEmpty (uint64_t grid_timestamp) const
uint16_t Size (uint64_t grid_timestamp) const
void AddObject (AgentHandle ah, AgentVector< AgentHandle > *successors, UniformGridEnvironment *grid)
 Adds an agent to this box. More...
Iterator begin (UniformGridEnvironment *grid) const

Public Attributes

Spinlock lock_
uint16_t length_
uint32_t timestamp_
AgentHandle start_

Detailed Description

A single unit cube of the grid.

Definition at line 69 of file uniform_grid_environment.h.

Constructor & Destructor Documentation

◆ Box() [1/2]

bdm::UniformGridEnvironment::Box::Box ( )

Definition at line 80 of file uniform_grid_environment.h.

◆ Box() [2/2]

bdm::UniformGridEnvironment::Box::Box ( const Box other)

Copy Constructor required for boxes_.resize() Since box values will be overwritten afterwards it forwards to the default ctor

Definition at line 84 of file uniform_grid_environment.h.

Member Function Documentation

◆ AddObject()

void bdm::UniformGridEnvironment::Box::AddObject ( AgentHandle  ah,
AgentVector< AgentHandle > *  successors,
UniformGridEnvironment grid 

Adds an agent to this box.

[in]agentThe object's identifier
AddObjectsuccessors The successors

Definition at line 109 of file uniform_grid_environment.h.

◆ begin()

Iterator bdm::UniformGridEnvironment::Box::begin ( UniformGridEnvironment grid) const

Definition at line 153 of file uniform_grid_environment.h.

◆ IsEmpty()

bool bdm::UniformGridEnvironment::Box::IsEmpty ( uint64_t  grid_timestamp) const

Definition at line 94 of file uniform_grid_environment.h.

◆ operator=()

Box& bdm::UniformGridEnvironment::Box::operator= ( const Box other)

Definition at line 86 of file uniform_grid_environment.h.

◆ Size()

uint16_t bdm::UniformGridEnvironment::Box::Size ( uint64_t  grid_timestamp) const

Definition at line 98 of file uniform_grid_environment.h.

Member Data Documentation

◆ length_

uint16_t bdm::UniformGridEnvironment::Box::length_

length of the linked list (i.e. number of agents) uint64_t, because sizeof(Box) = 16, for uint16_t and uint64_t

Definition at line 73 of file uniform_grid_environment.h.

◆ lock_

Spinlock bdm::UniformGridEnvironment::Box::lock_

Definition at line 70 of file uniform_grid_environment.h.

◆ start_

AgentHandle bdm::UniformGridEnvironment::Box::start_

start value of the linked list of agents inside this box. Next element can be found at successors_[start_]

Definition at line 78 of file uniform_grid_environment.h.

◆ timestamp_

uint32_t bdm::UniformGridEnvironment::Box::timestamp_

Definition at line 75 of file uniform_grid_environment.h.

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