Jpp
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>
19  public:
20  /**
21  * Virtual destructor.
22  */
24  {}
25 
26 
27  /**
28  * Increment iterator.
29  *
30  * \return this iterator
31  */
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::operator++
T & operator++()
Increment iterator.
Definition: JForwardIterator.hh:32
JLANG::JForwardIterator
Template interface for method bool increment().
Definition: JForwardIterator.hh:18
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JLANG::JForwardIterator::increment
virtual bool increment()=0
Increment iterator.
JLANG::JForwardIterator::~JForwardIterator
virtual ~JForwardIterator()
Virtual destructor.
Definition: JForwardIterator.hh:23
JLANG
Auxiliary classes and methods for language specific functionality.
Definition: JAbstractClass.hh:10
JLANG::JForwardIterator::operator++
T operator++(int)
Increment iterator.
Definition: JForwardIterator.hh:45