Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::FullContainerIterator< C > Class Template Reference

EventIterator that produces every single entry in a given container (which can be any STL-compatible container with begin() and end() methods). More...

#include <EventHandlerContainer.hxx>

Inheritance diagram for openlcb::FullContainerIterator< C >:
openlcb::EventIterator

Public Member Functions

 FullContainerIterator (C *container)
 
EventRegistryEntrynext_entry () OVERRIDE
 Steps the iteration.
 
void clear_iteration () OVERRIDE
 Stops iteration and resets iteration variables.
 
void init_iteration (EventReport *) OVERRIDE
 Starts the iteration.
 

Private Attributes

C::iterator it_
 
C * container_
 

Additional Inherited Members

- Protected Member Functions inherited from openlcb::EventIterator
 EventIterator ()
 Creates an EventIterator.
 

Detailed Description

template<class C>
class openlcb::FullContainerIterator< C >

EventIterator that produces every single entry in a given container (which can be any STL-compatible container with begin() and end() methods).

Definition at line 87 of file EventHandlerContainer.hxx.

Constructor & Destructor Documentation

◆ FullContainerIterator()

template<class C >
openlcb::FullContainerIterator< C >::FullContainerIterator ( C *  container)
inline

Definition at line 89 of file EventHandlerContainer.hxx.

Member Function Documentation

◆ clear_iteration()

template<class C >
void openlcb::FullContainerIterator< C >::clear_iteration ( )
inlinevirtual

Stops iteration and resets iteration variables.

Implements openlcb::EventIterator.

Definition at line 99 of file EventHandlerContainer.hxx.

◆ init_iteration()

template<class C >
void openlcb::FullContainerIterator< C >::init_iteration ( EventReport event)
inlinevirtual

Starts the iteration.

If the iteration is not done yet, call clear_iteration first.

Parameters
eventis the event report to reset the iteration for.

Implements openlcb::EventIterator.

Definition at line 102 of file EventHandlerContainer.hxx.

◆ next_entry()

template<class C >
EventRegistryEntry * openlcb::FullContainerIterator< C >::next_entry ( )
inlinevirtual

Steps the iteration.

Returns
the next entry or NULL if the iteration is done. May be called many times after the iteratin is ended and should consistently return NULL.

Implements openlcb::EventIterator.

Definition at line 93 of file EventHandlerContainer.hxx.

Member Data Documentation

◆ container_

template<class C >
C* openlcb::FullContainerIterator< C >::container_
private

Definition at line 108 of file EventHandlerContainer.hxx.

◆ it_

template<class C >
C::iterator openlcb::FullContainerIterator< C >::it_
private

Definition at line 107 of file EventHandlerContainer.hxx.


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