Loading...
Searching...
No Matches
BALL::HashGridBox3< Item > Class Template Reference
Foundation Classes » General datastructures » Generic Hash Associative Containers » Three-dimensional Hash Grid

`#include <BALL/DATATYPE/hashGrid.h>`

## Classes

class | BoxIteratorTraits
class | DataIteratorTraits

## Public Member Functions

Constructors and Destructors
| HashGridBox3 (HashGrid3< Item > *parent)
| Default constructor.
void | clear ()
| Clears the grid box.
void | destroy ()
Accessors
void | setParent (HashGrid3< Item > *p)
void | getIndices (Position &x, Position &y, Position &z)
Item * | find (const Item &item)
const Item * | find (const Item &item) const
| The const version of find().
Size | getSize () const
void | insert (const Item &item)
bool | remove (const Item &item)
bool | removeAll (const Item &item)
Miscellaneous
void | host (Visitor< HashGridBox3 > &visitor)
| Host method.
Predicates
bool | operator== (const HashGridBox3 &box) const
| Equality operator.
bool | operator!= (const HashGridBox3 &box) const
| Inequality operator.
bool | has (const Item &item) const
bool | isEmpty () const
Debugging and Diagnostics
bool | isValid () const
void | dump (std::ostream &s=std::cout, Size depth=0) const
Internal Iterators
bool | apply (UnaryProcessor< Item > &processor)
bool | apply (UnaryProcessor< HashGridBox3< Item > > &processor)

## External Iterators

typedef Position | BoxIteratorPosition
typedef ForwardIterator< HashGridBox3< Item >, HashGridBox3< Item >, BoxIteratorPosition, BoxIteratorTraits > | BoxIterator
typedef ConstForwardIterator< HashGridBox3< Item >, HashGridBox3< Item >, BoxIteratorPosition, BoxIteratorTraits > | ConstBoxIterator
| This is the const version of BoxIterator .
typedef std::forward_list< Item > | DataContainer
typedef DataContainer::iterator | DataIteratorPosition
typedef ForwardIterator< HashGridBox3< Item >, Item, DataIteratorPosition, DataIteratorTraits > | DataIterator
typedef ConstForwardIterator< HashGridBox3< Item >, Item, DataIteratorPosition, DataIteratorTraits > | ConstDataIterator
class | BoxIteratorTraits
class | DataIteratorTraits
HashGrid3< Item > * | parent
DataContainer | data
BoxIterator | beginBox ()
| get the first box
BoxIterator | endBox ()
| get the last box
ConstBoxIterator | beginBox () const
| get the first box
ConstBoxIterator | endBox () const
| get the last box
DataIterator | beginData ()
DataIterator | endData ()
ConstDataIterator | beginData () const
ConstDataIterator | endData () const

## Detailed Description

template<typename Item>
class BALL::HashGridBox3< Item >

Grid Box Class. These boxes represent the buckets of a threedimensional hash grid. Every such box contains a linear list of the objects that are contained in this box. This list is accessible through a DataIterator.

Definition at line 54 of file hashGrid.h.

## Member Typedef Documentation

## BoxIterator

template<typename Item>

typedef ForwardIterator<HashGridBox3<Item>, HashGridBox3<Item>, BoxIteratorPosition, BoxIteratorTraits> BALL::HashGridBox3< Item >::BoxIterator

BoxIterators iterate over all boxes that lie in the direct neighborhood to a box, and over the box itself. Such an iterator traverses over 27 boxes.

Definition at line 327 of file hashGrid.h.

## BoxIteratorPosition

template<typename Item>

typedef Position BALL::HashGridBox3< Item >::BoxIteratorPosition

Definition at line 178 of file hashGrid.h.

## ConstBoxIterator

template<typename Item>

typedef ConstForwardIterator<HashGridBox3<Item>, HashGridBox3<Item>, BoxIteratorPosition, BoxIteratorTraits> BALL::HashGridBox3< Item >::ConstBoxIterator

This is the const version of BoxIterator .

Definition at line 346 of file hashGrid.h.

## ConstDataIterator

template<typename Item>

typedef ConstForwardIterator<HashGridBox3<Item>, Item, DataIteratorPosition, DataIteratorTraits> BALL::HashGridBox3< Item >::ConstDataIterator

Const data iterator for grid boxes. This is the const version of DataIterator

Definition at line 513 of file hashGrid.h.

## DataContainer

template<typename Item>

typedef std::forward_list<Item> BALL::HashGridBox3< Item >::DataContainer

Definition at line 360 of file hashGrid.h.

## DataIterator

template<typename Item>

typedef ForwardIterator<HashGridBox3<Item>, Item, DataIteratorPosition, DataIteratorTraits> BALL::HashGridBox3< Item >::DataIterator

Data iterator for grid boxes. This iterator traverses the list of data items store in a HashGridBox3 .

Definition at line 492 of file hashGrid.h.

## DataIteratorPosition

template<typename Item>

typedef DataContainer::iterator BALL::HashGridBox3< Item >::DataIteratorPosition

Definition at line 362 of file hashGrid.h.

## Constructor & Destructor Documentation

## HashGridBox3()

template<typename Item>

BALL::HashGridBox3< Item >::HashGridBox3 | ( | HashGrid3< Item > * | parent | ) |

Default constructor.

Definition at line 535 of file hashGrid.h.

## Member Function Documentation

## apply() [1/2]

template<typename Item>

bool BALL::HashGridBox3< Item >::apply | ( | UnaryProcessor< HashGridBox3< Item > > & | processor | ) |

Definition at line 708 of file hashGrid.h.

## apply() [2/2]

template<typename Item>

bool BALL::HashGridBox3< Item >::apply | ( | UnaryProcessor< Item > & | processor | ) |

Definition at line 685 of file hashGrid.h.

## beginBox() [1/2]

template<typename Item>

BoxIterator BALL::HashGridBox3< Item >::beginBox | ( |  | ) |

inline

get the first box

Definition at line 330 of file hashGrid.h.

## beginBox() [2/2]

template<typename Item>

ConstBoxIterator BALL::HashGridBox3< Item >::beginBox | ( |  | ) | const

inline

get the first box

Definition at line 349 of file hashGrid.h.

## beginData() [1/2]

template<typename Item>

DataIterator BALL::HashGridBox3< Item >::beginData | ( |  | ) |

inline

Definition at line 495 of file hashGrid.h.

## beginData() [2/2]

template<typename Item>

ConstDataIterator BALL::HashGridBox3< Item >::beginData | ( |  | ) | const

inline

Definition at line 516 of file hashGrid.h.

## clear()

template<typename Item>

void BALL::HashGridBox3< Item >::clear | ( |  | ) |

Clears the grid box.

Definition at line 541 of file hashGrid.h.

## destroy()

template<typename Item>

BALL_INLINE void BALL::HashGridBox3< Item >::destroy | ( |  | ) |

Clears the grid box. Same as clear.

Definition at line 548 of file hashGrid.h.

## dump()

template<typename Item>

void BALL::HashGridBox3< Item >::dump | ( | std::ostream & | s = std::cout,
|  | Size | depth = 0 ) const

Definition at line 664 of file hashGrid.h.

## endBox() [1/2]

template<typename Item>

BoxIterator BALL::HashGridBox3< Item >::endBox | ( |  | ) |

inline

get the last box

Definition at line 336 of file hashGrid.h.

## endBox() [2/2]

template<typename Item>

ConstBoxIterator BALL::HashGridBox3< Item >::endBox | ( |  | ) | const

inline

get the last box

Definition at line 355 of file hashGrid.h.

## endData() [1/2]

template<typename Item>

DataIterator BALL::HashGridBox3< Item >::endData | ( |  | ) |

inline

Definition at line 501 of file hashGrid.h.

## endData() [2/2]

template<typename Item>

ConstDataIterator BALL::HashGridBox3< Item >::endData | ( |  | ) | const

inline

Definition at line 522 of file hashGrid.h.

## find() [1/2]

template<typename Item>

Item * BALL::HashGridBox3< Item >::find | ( | const Item & | item | ) |

Find an item in the item list of this grid box.

Parameters

  item | the item to be searched for

Returns
  a pointer to the desired item or a NULL pointer, if the item could not be found.

Definition at line 567 of file hashGrid.h.

## find() [2/2]

template<typename Item>

BALL_INLINE const Item * BALL::HashGridBox3< Item >::find | ( | const Item & | item | ) | const

The const version of find().

Definition at line 581 of file hashGrid.h.

## getIndices()

template<typename Item>

BALL_INLINE void BALL::HashGridBox3< Item >::getIndices | ( | Position & | x,
|  | Position & | y,
|  | Position & | z )

Return the indices of this box in the parent HashGrid

Definition at line 561 of file hashGrid.h.

## getSize()

template<typename Item>

Size BALL::HashGridBox3< Item >::getSize | ( |  | ) | const

Counts all items in the data item list (in linear time).

Returns
  the size of the data item list.

Definition at line 587 of file hashGrid.h.

## has()

template<typename Item>

BALL_INLINE bool BALL::HashGridBox3< Item >::has | ( | const Item & | item | ) | const

Test whether an item is in the data item list

Parameters

  item |

Returns
  bool - true if instance has item, false otherwise.

Definition at line 644 of file hashGrid.h.

## host()

template<typename Item>

BALL_INLINE void BALL::HashGridBox3< Item >::host | ( | Visitor< HashGridBox3< Item > > & | visitor | ) |

Host method.

Definition at line 624 of file hashGrid.h.

## insert()

template<typename Item>

BALL_INLINE void BALL::HashGridBox3< Item >::insert | ( | const Item & | item | ) |

Insert an item into the data item list of a grid box.

Parameters

  item | the item to be inserted

Definition at line 594 of file hashGrid.h.

## isEmpty()

template<typename Item>

BALL_INLINE bool BALL::HashGridBox3< Item >::isEmpty | ( |  | ) | const

Test, whether this box is empty, i. e. the data item list contains nothing

Returns
  bool - true, if this is empty. false otherwise.

Definition at line 651 of file hashGrid.h.

## isValid()

template<typename Item>

bool BALL::HashGridBox3< Item >::isValid | ( |  | ) | const

Definition at line 657 of file hashGrid.h.

## operator!=()

template<typename Item>

BALL_INLINE bool BALL::HashGridBox3< Item >::operator!= | ( | const HashGridBox3< Item > & | box | ) | const

Inequality operator.

Definition at line 637 of file hashGrid.h.

## operator==()

template<typename Item>

bool BALL::HashGridBox3< Item >::operator== | ( | const HashGridBox3< Item > & | box | ) | const

Equality operator.

Definition at line 630 of file hashGrid.h.

## remove()

template<typename Item>

bool BALL::HashGridBox3< Item >::remove | ( | const Item & | item | ) |

Remove the first occurrence of a certain item from the data item list.

Parameters

  item | the item to be removed

Returns
  bool - true, if the item could be removed, false otherwise.

Definition at line 600 of file hashGrid.h.

## removeAll()

template<typename Item>

bool BALL::HashGridBox3< Item >::removeAll | ( | const Item & | item | ) |

Remove all occurences of a certain item from the data item list.

Parameters

  item | the item to be removed

Returns
  bool - true, if the item could be removed, false otherwise.

Definition at line 615 of file hashGrid.h.

## setParent()

template<typename Item>

BALL_INLINE void BALL::HashGridBox3< Item >::setParent | ( | HashGrid3< Item > * | p | ) |

Definition at line 554 of file hashGrid.h.

## Friends And Related Symbol Documentation

## BoxIteratorTraits

template<typename Item>

friend class BoxIteratorTraits

friend

Definition at line 318 of file hashGrid.h.

## DataIteratorTraits

template<typename Item>

friend class DataIteratorTraits

friend

Definition at line 484 of file hashGrid.h.

## Member Data Documentation

## data

template<typename Item>

DataContainer BALL::HashGridBox3< Item >::data

Definition at line 531 of file hashGrid.h.

## parent

template<typename Item>

HashGrid3<Item>* BALL::HashGridBox3< Item >::parent

Definition at line 529 of file hashGrid.h.