![]() |
User Manual, Developers Guide and API Documentation |
![]() |
#include <RoundRobin.hpp>


Public Member Functions | |
| void | add (Element e) |
| Add an element to the container. | |
| void | cancelRound () const |
| Cancel an already started round. | |
| void | clear () |
| const Element | current () const |
| Returns the next element to operate on without advancing to the element after the next element. | |
| bool | empty () const |
| True if container empty. | |
| void | endRound () |
| End a round. | |
| Container | getAllElements () const |
| Returns all elements. | |
| bool | hasNext () const |
| True as long as there elements left in one round. | |
| bool | isInRound () const |
| Return if currently in round. | |
| const Element | next () const |
| Returns the next element to operate on. | |
| void | remove (Element e) |
| Remove an element from the container. | |
| RoundRobin () | |
| long int | size () const |
| Number of elements in the container. | |
| void | startRound () const |
| Start a new round. | |
Private Types | |
| typedef std::vector< Element > | Container |
| typedef T | Element |
Private Member Functions | |
| void | advanceCursor () const |
Private Attributes | |
| long int | countdown |
| long int | cursor |
| Container | elements |
| long int | first |
| bool | inRound |
Definition at line 39 of file RoundRobin.hpp.
typedef std::vector<Element> wns::RoundRobin< T >::Container [private] |
Definition at line 42 of file RoundRobin.hpp.
typedef T wns::RoundRobin< T >::Element [private] |
Definition at line 41 of file RoundRobin.hpp.
| wns::RoundRobin< T >::RoundRobin | ( | ) | [inline, explicit] |
Definition at line 45 of file RoundRobin.hpp.
| void wns::RoundRobin< T >::add | ( | Element | e | ) | [inline] |
Definition at line 172 of file RoundRobin.hpp.
| void wns::RoundRobin< T >::advanceCursor | ( | ) | const [inline, private] |
Definition at line 238 of file RoundRobin.hpp.
| void wns::RoundRobin< T >::cancelRound | ( | ) | const [inline] |
Definition at line 85 of file RoundRobin.hpp.
| void wns::RoundRobin< T >::clear | ( | ) | [inline] |
Definition at line 220 of file RoundRobin.hpp.
| const Element wns::RoundRobin< T >::current | ( | ) | const [inline] |
| bool wns::RoundRobin< T >::empty | ( | ) | const [inline] |
Definition at line 158 of file RoundRobin.hpp.
| void wns::RoundRobin< T >::endRound | ( | ) | [inline] |
Call this basically to unseal the container (see startRound())
Definition at line 74 of file RoundRobin.hpp.
| Container wns::RoundRobin< T >::getAllElements | ( | ) | const [inline] |
| bool wns::RoundRobin< T >::hasNext | ( | ) | const [inline] |
True as long as there elements left in one round, i.e. not all elements have been visited.
Definition at line 139 of file RoundRobin.hpp.
| bool wns::RoundRobin< T >::isInRound | ( | ) | const [inline] |
Definition at line 96 of file RoundRobin.hpp.
| const Element wns::RoundRobin< T >::next | ( | ) | const [inline] |
| void wns::RoundRobin< T >::remove | ( | Element | e | ) | [inline] |
Removing an element will keep the first pointing to the same element after removing. If the element is removed the first is currently pointing to, the first is advanced to the next element.
Definition at line 196 of file RoundRobin.hpp.
| long int wns::RoundRobin< T >::size | ( | ) | const [inline] |
Definition at line 149 of file RoundRobin.hpp.
| void wns::RoundRobin< T >::startRound | ( | ) | const [inline] |
This effectively seals the container. In debug mode no add() or remove() is possible.
Definition at line 60 of file RoundRobin.hpp.
long int wns::RoundRobin< T >::countdown [mutable, private] |
Definition at line 246 of file RoundRobin.hpp.
long int wns::RoundRobin< T >::cursor [mutable, private] |
Definition at line 245 of file RoundRobin.hpp.
Container wns::RoundRobin< T >::elements [private] |
Definition at line 242 of file RoundRobin.hpp.
long int wns::RoundRobin< T >::first [private] |
Definition at line 243 of file RoundRobin.hpp.
bool wns::RoundRobin< T >::inRound [mutable, private] |
Definition at line 244 of file RoundRobin.hpp.
1.5.5