BALL  1.5.0
Classes | List of all members

#include <BALL/DATATYPE/hashGrid.h>

Classes

class  BoxIteratorTraits
 
class  DataIteratorTraits
 

Public Member Functions

Constructors and Destructors
 HashGridBox3 (HashGrid3< Item > *parent)
 Default constructor. More...
 
void clear ()
 Clears the grid box. More...
 
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() More...
 
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. More...
 
Predicates
bool operator== (const HashGridBox3 &box) const
 Equality operator. More...
 
bool operator!= (const HashGridBox3 &box) const
 Inequality operator. More...
 
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, BoxIteratorTraitsBoxIterator
 
typedef ConstForwardIterator< HashGridBox3< Item >, HashGridBox3< Item >, BoxIteratorPosition, BoxIteratorTraitsConstBoxIterator
 This is the const version of BoxIterator . More...
 
typedef std::forward_list< Item > DataContainer
 
typedef DataContainer::iterator DataIteratorPosition
 
typedef ForwardIterator< HashGridBox3< Item >, Item, DataIteratorPosition, DataIteratorTraitsDataIterator
 
typedef ConstForwardIterator< HashGridBox3< Item >, Item, DataIteratorPosition, DataIteratorTraitsConstDataIterator
 
class BoxIteratorTraits
 
class DataIteratorTraits
 
HashGrid3< Item > * parent
 
DataContainer data
 
BoxIterator beginBox ()
 get the first box More...
 
BoxIterator endBox ()
 get the last box More...
 
ConstBoxIterator beginBox () const
 get the first box More...
 
ConstBoxIterator endBox () const
 get the last box More...
 
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

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

This is the const version of BoxIterator .

Definition at line 346 of file hashGrid.h.

◆ 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

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
itemthe 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>
const BALL_INLINE 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
itemthe 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
itemthe 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
itemthe 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 Function 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.