Lolly 1.4.27
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iterator_rep< T > Class Template Referenceabstract

An abstract base class for iterator implementation. More...

#include <iterator.hpp>

Inheritance diagram for iterator_rep< T >:
Inheritance graph
[legend]
Collaboration diagram for iterator_rep< T >:
Collaboration graph
[legend]

Public Member Functions

 iterator_rep ()
 Constructor. Increments the iterator count.
 
virtual ~iterator_rep ()
 Destructor. Decrements the iterator count.
 
virtual bool busy ()=0
 Returns whether the iterator has another element.
 
virtualnext ()=0
 Returns the current element of the iterator, and move the iterator forward.
 
virtualcurrent ()=0
 Returns the current element of the iterator.
 
virtual void increase ()=0
 Increase the iterator.
 
virtual int remains ()
 Returns the number of elements remaining in the iterator.
 
- Public Member Functions inherited from abstract_struct
 abstract_struct ()
 Default constructor for the abstract object. Sets the reference count to 0.
 
virtual ~abstract_struct ()
 Virtual destructor for the abstract object. Decrements the reference count.
 

Additional Inherited Members

- Public Attributes inherited from abstract_struct
int ref_count
 The reference count for the abstract object.
 

Detailed Description

template<class T>
class iterator_rep< T >

An abstract base class for iterator implementation.

Template Parameters
TThe type for the iterator's return value.

Definition at line 21 of file iterator.hpp.

Constructor & Destructor Documentation

◆ iterator_rep()

template<class T >
iterator_rep< T >::iterator_rep ( )
inline

Constructor. Increments the iterator count.

Definition at line 107 of file iterator.hpp.

#define TM_DEBUG(x)
Debugging macro used to disable debugging output.
Definition classdef.hpp:13
int iterator_count

◆ ~iterator_rep()

template<class T >
virtual iterator_rep< T >::~iterator_rep ( )
inlinevirtual

Destructor. Decrements the iterator count.

Definition at line 107 of file iterator.hpp.

Member Function Documentation

◆ busy()

template<class T >
virtual bool iterator_rep< T >::busy ( )
pure virtual

Returns whether the iterator has another element.

Returns
True if the iterator has another element, false otherwise.

Implemented in hashset_iterator_rep< T >, and hashmap_iterator_rep< T, U >.

◆ next()

template<class T >
virtual T iterator_rep< T >::next ( )
pure virtual

Returns the current element of the iterator, and move the iterator forward.

Returns
The current element of the iterator.

Implemented in hashset_iterator_rep< T >, and hashmap_iterator_rep< T, U >.

◆ current()

template<class T >
virtual T iterator_rep< T >::current ( )
pure virtual

Returns the current element of the iterator.

Returns
The current element of the iterator.

Implemented in hashset_iterator_rep< T >, and hashmap_iterator_rep< T, U >.

◆ increase()

template<class T >
virtual void iterator_rep< T >::increase ( )
pure virtual

Increase the iterator.

Implemented in hashset_iterator_rep< T >, and hashmap_iterator_rep< T, U >.

◆ remains()

template<class T >
int iterator_rep< T >::remains ( )
virtual

Returns the number of elements remaining in the iterator.

Returns
The number of elements remaining in the iterator.

Definition at line 20 of file iterator.ipp.

20 {
21 if (busy ()) return -1;
22 else return 0;
23}
virtual bool busy()=0
Returns whether the iterator has another element.

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