ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
A space hash implementation that does not rely on std::map or std::tr1:unordered_map. More...
#include <space_hash_native.h>
Classes | |
struct | SBucket |
A bucket of the native space hash. | |
Public Member Functions | |
CSpaceHashNative () | |
Class constructor. | |
~CSpaceHashNative () | |
Class destructor. | |
void | Clear () |
Empties all the buckets in the space hash. | |
virtual void | SetSize (size_t un_size) |
Sets the size of the space hash. | |
virtual void | Update () |
Updates the entire space hash. | |
virtual void | UpdateCell (SInt32 n_i, SInt32 n_j, SInt32 n_k, Element &c_element) |
Adds an element to a cell of the space hash. | |
virtual bool | CheckCell (SInt32 n_i, SInt32 n_j, SInt32 n_k, typename CSpaceHash< Element, Updater >::TElementList &t_elements) |
Looks for elements to process in a cell. | |
virtual void | Dump (CARGoSLog &c_os) |
A space hash implementation that does not rely on std::map or std::tr1:unordered_map.
It is much more performant than the standard hash table implementations.
Definition at line 19 of file space_hash_native.h.
argos::CSpaceHashNative< Element, Updater >::CSpaceHashNative | ( | ) | [inline] |
Class constructor.
The size of the space hash (the number of buckets) is set to zero. To be able to use the space hash, you first must set the size to an appropriate value.
Definition at line 166 of file space_hash_native.h.
argos::CSpaceHashNative< Element, Updater >::~CSpaceHashNative | ( | ) | [inline] |
Class destructor.
Definition at line 173 of file space_hash_native.h.
virtual bool argos::CSpaceHashNative< Element, Updater >::CheckCell | ( | SInt32 | n_i, |
SInt32 | n_j, | ||
SInt32 | n_k, | ||
typename CSpaceHash< Element, Updater >::TElementList & | t_elements | ||
) | [inline, virtual] |
Looks for elements to process in a cell.
n_i | The X coordinate of the space hash cell. |
n_j | The Y coordinate of the space hash cell. |
n_k | The Z coordinate of the space hash cell. |
The | list of elements to process. |
Definition at line 249 of file space_hash_native.h.
void argos::CSpaceHashNative< Element, Updater >::Clear | ( | ) | [inline] |
Empties all the buckets in the space hash.
Definition at line 181 of file space_hash_native.h.
virtual void argos::CSpaceHashNative< Element, Updater >::Dump | ( | CARGoSLog & | c_os | ) | [inline, virtual] |
Implements argos::CAbstractSpaceHash< Element >.
Definition at line 282 of file space_hash_native.h.
virtual void argos::CSpaceHashNative< Element, Updater >::SetSize | ( | size_t | un_size | ) | [inline, virtual] |
Sets the size of the space hash.
The size corresponds to the number of buckets.
un_size | The size of the space hash. |
Reimplemented from argos::CAbstractSpaceHash< Element >.
Definition at line 192 of file space_hash_native.h.
virtual void argos::CSpaceHashNative< Element, Updater >::Update | ( | ) | [inline, virtual] |
Updates the entire space hash.
It calls the updater for all the elements held by the space hash.
Reimplemented from argos::CSpaceHash< Element, Updater >.
Definition at line 203 of file space_hash_native.h.
virtual void argos::CSpaceHashNative< Element, Updater >::UpdateCell | ( | SInt32 | n_i, |
SInt32 | n_j, | ||
SInt32 | n_k, | ||
Element & | c_element | ||
) | [inline, virtual] |
Adds an element to a cell of the space hash.
n_x | The x coordinate of the cell. |
n_y | The y coordinate of the cell. |
n_z | The z coordinate of the cell. |
c_element | The element to add. |
Implements argos::CAbstractSpaceHash< Element >.
Definition at line 217 of file space_hash_native.h.