Empirical
Public Member Functions | List of all members
emp::World_iterator< WORLD > Class Template Reference

#include <World_iterator.h>

Public Member Functions

 World_iterator (world_t *_w, size_t _p=0)
 
 World_iterator (const World_iterator &_in)
 Create an iterator pointing to the same position as another iterator. More...
 
this_toperator= (const World_iterator &_in)
 Assign this iterator to the position of another iterator. More...
 
this_toperator++ ()
 Advance iterator to the next non-empty cell in the world. More...
 
this_toperator-- ()
 Backup iterator to the previos non-empty cell in the world. More...
 
bool operator== (const this_t &rhs) const
 Compare two iterators to determine if they point to identical positions in the world. More...
 
bool operator!= (const this_t &rhs) const
 Compare two iterators to determine if they point to different positions in the world. More...
 
bool operator< (const this_t &rhs) const
 Determine if this iterator points to a position in the world BEFORE another iterator. More...
 
bool operator<= (const this_t &rhs) const
 Determine if this iterator points to a position in the world BEFORE or the SAME AS another iterator. More...
 
bool operator> (const this_t &rhs) const
 Determine if this iterator points to a position in the world AFTER another iterator. More...
 
bool operator>= (const this_t &rhs) const
 Determine if this iterator points to a position in the world AFTER or the SAME AS another iterator. More...
 
org_t & operator* ()
 Return a reference to the organism pointed to by this iterator. More...
 
const org_t & operator* () const
 Return a const reference to the organism pointed to by this iterator. More...
 
 operator bool () const
 Is this iterator pointing to a valid cell in the world? More...
 
this_t begin ()
 Return an iterator pointing to the first occupied cell in the world. More...
 
const this_t begin () const
 Return a const iterator pointing to the first occupied cell in the world. More...
 
this_t end ()
 Return an iterator pointing to just past the end of the world. More...
 
const this_t end () const
 Return a const iterator pointing to just past the end of the world. More...
 

Constructor & Destructor Documentation

template<typename WORLD >
emp::World_iterator< WORLD >::World_iterator ( world_t *  _w,
size_t  _p = 0 
)
inline

Create an iterator in the specified world pointing to the first occupied cell after the provided start position.

template<typename WORLD >
emp::World_iterator< WORLD >::World_iterator ( const World_iterator< WORLD > &  _in)
inline

Create an iterator pointing to the same position as another iterator.

Member Function Documentation

template<typename WORLD >
this_t emp::World_iterator< WORLD >::begin ( )
inline

Return an iterator pointing to the first occupied cell in the world.

template<typename WORLD >
const this_t emp::World_iterator< WORLD >::begin ( ) const
inline

Return a const iterator pointing to the first occupied cell in the world.

template<typename WORLD >
this_t emp::World_iterator< WORLD >::end ( )
inline

Return an iterator pointing to just past the end of the world.

template<typename WORLD >
const this_t emp::World_iterator< WORLD >::end ( ) const
inline

Return a const iterator pointing to just past the end of the world.

template<typename WORLD >
emp::World_iterator< WORLD >::operator bool ( ) const
inline

Is this iterator pointing to a valid cell in the world?

template<typename WORLD >
bool emp::World_iterator< WORLD >::operator!= ( const this_t rhs) const
inline

Compare two iterators to determine if they point to different positions in the world.

template<typename WORLD >
org_t& emp::World_iterator< WORLD >::operator* ( )
inline

Return a reference to the organism pointed to by this iterator.

template<typename WORLD >
const org_t& emp::World_iterator< WORLD >::operator* ( ) const
inline

Return a const reference to the organism pointed to by this iterator.

template<typename WORLD >
this_t& emp::World_iterator< WORLD >::operator++ ( )
inline

Advance iterator to the next non-empty cell in the world.

template<typename WORLD >
this_t& emp::World_iterator< WORLD >::operator-- ( )
inline

Backup iterator to the previos non-empty cell in the world.

template<typename WORLD >
bool emp::World_iterator< WORLD >::operator< ( const this_t rhs) const
inline

Determine if this iterator points to a position in the world BEFORE another iterator.

template<typename WORLD >
bool emp::World_iterator< WORLD >::operator<= ( const this_t rhs) const
inline

Determine if this iterator points to a position in the world BEFORE or the SAME AS another iterator.

template<typename WORLD >
this_t& emp::World_iterator< WORLD >::operator= ( const World_iterator< WORLD > &  _in)
inline

Assign this iterator to the position of another iterator.

template<typename WORLD >
bool emp::World_iterator< WORLD >::operator== ( const this_t rhs) const
inline

Compare two iterators to determine if they point to identical positions in the world.

template<typename WORLD >
bool emp::World_iterator< WORLD >::operator> ( const this_t rhs) const
inline

Determine if this iterator points to a position in the world AFTER another iterator.

template<typename WORLD >
bool emp::World_iterator< WORLD >::operator>= ( const this_t rhs) const
inline

Determine if this iterator points to a position in the world AFTER or the SAME AS another iterator.


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