Jpp
JBidirectionalIterator.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JBIDIRECTIONALITERATOR__
2 #define __JLANG__JBIDIRECTIONALITERATOR__
3 
5 
6 /**
7  * \author mdejong
8  */
9 
10 namespace JLANG {}
11 namespace JPP { using namespace JLANG; }
12 
13 namespace JLANG {
14 
15  /**
16  * Template interface for method bool decrement().
17  * This interface implements the pre-fix and post-fix operators --.
18  */
19  template<class T>
21  public JForwardIterator<T>
22  {
23  public:
24  /**
25  * Virtual destructor.
26  */
28  {}
29 
30 
31  /**
32  * Decrement iterator.
33  *
34  * \return this iterator
35  */
37  {
38  this->decrement();
39 
40  return static_cast<T&>(*this);
41  }
42 
43 
44  /**
45  * Decrement iterator.
46  *
47  * \return decrement iterator
48  */
49  T operator--(int)
50  {
51  const T tmp(static_cast<const T&>(*this));
52 
53  this->decrement();
54 
55  return tmp;
56  }
57 
58 
59  /**
60  * Decrement iterator.
61  *
62  * \return true if decremented; else false
63  */
64  virtual bool decrement() = 0;
65  };
66 }
67 
68 #endif
69 
70 
71 
JForwardIterator.hh
JLANG::JForwardIterator
Template interface for method bool increment().
Definition: JForwardIterator.hh:18
JLANG::JBidirectionalIterator
Template interface for method bool decrement().
Definition: JBidirectionalIterator.hh:20
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JLANG::JBidirectionalIterator::operator--
T operator--(int)
Decrement iterator.
Definition: JBidirectionalIterator.hh:49
JLANG::JBidirectionalIterator::~JBidirectionalIterator
virtual ~JBidirectionalIterator()
Virtual destructor.
Definition: JBidirectionalIterator.hh:27
JLANG::JBidirectionalIterator::operator--
T & operator--()
Decrement iterator.
Definition: JBidirectionalIterator.hh:36
JLANG
Auxiliary classes and methods for language specific functionality.
Definition: JAbstractClass.hh:10
JLANG::JBidirectionalIterator::decrement
virtual bool decrement()=0
Decrement iterator.