Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JLang
JForwardIterator.hh
Go to the documentation of this file.
1
#ifndef __JLANG__JFORWARDITERATOR__
2
#define __JLANG__JFORWARDITERATOR__
3
4
/**
5
* \author mdejong
6
*/
7
8
namespace
JLANG {}
9
namespace
JPP {
using namespace
JLANG; }
10
11
namespace
JLANG {
12
13
/**
14
* Template interface for method bool increment().
15
* This interface implements the pre-fix and post-fix operators <tt>++</tt>.
16
*/
17
template
<
class
T>
18
class
JForwardIterator
{
19
public
:
20
/**
21
* Virtual destructor.
22
*/
23
virtual
~JForwardIterator
()
24
{}
25
26
27
/**
28
* Increment iterator.
29
*
30
* \return this iterator
31
*/
32
T&
operator++
()
33
{
34
this->
increment
();
35
36
return
static_cast<
T&
>
(*this);
37
}
38
39
40
/**
41
* Increment iterator.
42
*
43
* \return previous iterator
44
*/
45
T
operator++
(
int
)
46
{
47
const
T tmp(static_cast<const T&>(*
this
));
48
49
this->
increment
();
50
51
return
tmp;
52
}
53
54
55
/**
56
* Increment iterator.
57
*
58
* \return true if incremented; else false
59
*/
60
virtual
bool
increment
() = 0;
61
};
62
}
63
64
#endif
65
JLANG::JForwardIterator::~JForwardIterator
virtual ~JForwardIterator()
Virtual destructor.
Definition:
JForwardIterator.hh:23
JLANG::JForwardIterator
Template interface for method bool increment().
Definition:
JForwardIterator.hh:18
JLANG::JForwardIterator::operator++
T operator++(int)
Increment iterator.
Definition:
JForwardIterator.hh:45
JLANG::JForwardIterator::increment
virtual bool increment()=0
Increment iterator.
JLANG::JForwardIterator::operator++
T & operator++()
Increment iterator.
Definition:
JForwardIterator.hh:32
Generated by
1.8.5