PolyBoRi
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
libpolybori
include
polybori
common
TransformedSequence.h
Go to the documentation of this file.
1
// -*- c++ -*-
2
//*****************************************************************************
14
//*****************************************************************************
15
16
#ifndef polybori_TransformedSequence_h_
17
#define polybori_TransformedSequence_h_
18
19
// include basic definitions
20
#include <
polybori/pbori_defs.h
>
21
#include <
polybori/iterators/TransformedIterator.h
>
22
23
#include <vector>
24
#include <algorithm>
25
26
BEGIN_NAMESPACE_PBORI
27
28
33
template
<
class
SequenceType,
class
OperatorType>
34
class
TransformedSequence
{
35
36
public
:
37
typedef
SequenceType
sequence_type
;
38
typedef
typename
sequence_type::const_iterator
sequence_iterator
;
39
typedef
OperatorType
operator_type
;
40
typedef
TransformedIterator<sequence_iterator, operator_type>
const_iterator
;
41
42
44
TransformedSequence
(
const
sequence_type
& seq,
const
operator_type
& func):
45
m_sequence(seq), m_func(func) {
46
}
47
49
50
const_iterator
begin
()
const
{
51
return
const_iterator
(m_sequence.begin(), m_func); }
52
53
const_iterator
end
()
const
{
54
return
const_iterator
(m_sequence.end(), m_func); }
56
57
private
:
58
sequence_type m_sequence;
59
operator_type m_func;
60
};
61
62
63
END_NAMESPACE_PBORI
64
65
#endif
/* polybori_TransformedSequence_h_ */
Generated by
1.8.3.1