PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
libpolybori
include
polybori
iterators
CVariableIter.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
//*****************************************************************************
13
//*****************************************************************************
14
15
#ifndef polybori_iterators_CVariableIter_h_
16
#define polybori_iterators_CVariableIter_h_
17
18
// include basic definitions
19
#include <
polybori/pbori_defs.h
>
20
21
BEGIN_NAMESPACE_PBORI
22
31
template
<
class
Iterator,
class
VariableType>
32
class
CVariableIter
:
33
public
boost::iterator_facade<
34
CVariableIter<Iterator, VariableType>,
35
VariableType,
36
typename Iterator::iterator_category,
37
VariableType
38
> {
39
40
public
:
42
typedef
Iterator
iterator_type
;
43
45
typedef
VariableType
var_type
;
46
48
typedef
typename
var_type::ring_type
ring_type
;
49
51
typedef
CVariableIter<iterator_type, var_type>
self
;
52
54
CVariableIter
(): m_iter(), m_ring() {}
55
57
CVariableIter
(
const
iterator_type
& rhs,
const
ring_type
& ring):
58
m_iter(rhs), m_ring(ring) {}
59
61
bool
isEnd
()
const
{
return
m_iter.isEnd(); }
62
64
void
increment
() { ++m_iter; }
65
67
var_type
dereference
()
const
{
return
var_type
(*m_iter, m_ring); }
68
70
bool
equal
(
const
self
& rhs)
const
{
return
m_iter == rhs.m_iter; }
71
72
private
:
74
iterator_type m_iter;
75
77
ring_type m_ring;
78
};
79
80
END_NAMESPACE_PBORI
81
82
83
#endif // CVariableIter_h_
Generated by
1.8.3.1