PBoRiOutIter.h
Go to the documentation of this file.
// -*- c++ -*-
//*****************************************************************************
//*****************************************************************************
#ifndef polybori_iterators_PBoRiOutIter_h_
#define polybori_iterators_PBoRiOutIter_h_
// include basic definitions
#include <polybori/pbori_defs.h>
BEGIN_NAMESPACE_PBORI
template <class DataType, class RhsType, class BinOp>
class PBoRiOutIter {
public:
typedef DataType data_type;
typedef RhsType rhs_type;
typedef BinOp op_type;
typedef PBoRiOutIter<data_type, rhs_type, op_type> self;
typedef std::output_iterator_tag iterator_category;
typedef void difference_type;
typedef void pointer;
typedef void reference;
typedef void value_type;
PBoRiOutIter(data_type& data_, op_type op_ = op_type()):
data(data_), op(op_) {}
PBoRiOutIter(const self& rhs):
data(rhs.data), op(rhs.op) {}
~PBoRiOutIter() {}
self& operator*() { return *this; }
self& operator=(const self& rhs) {
data = rhs.data;
op = rhs.op;
return *this;
}
self& operator=(rhs_type rhs){
op(data, rhs);
return *this;
}
self& operator++() { return *this; }
self operator++(int) { return *this; }
protected:
data_type& data;
op_type op;
};
END_NAMESPACE_PBORI
#endif
polybori::PBoRiOutIter::data
data_type & data
Definition: PBoRiOutIter.h:90
polybori::PBoRiOutIter::PBoRiOutIter
PBoRiOutIter(data_type &data_, op_type op_=op_type())
Constructor.
Definition: PBoRiOutIter.h:56
polybori::PBoRiOutIter::op_type
BinOp op_type
Type of binary operation used to transform data and rhs.
Definition: PBoRiOutIter.h:41
END_NAMESPACE_PBORI
#define END_NAMESPACE_PBORI
Finish project's namespace.
Definition: pbori_defs.h:77
polybori::PBoRiOutIter::operator*
self & operator*()
Definition: PBoRiOutIter.h:68
polybori::PBoRiOutIter::difference_type
void difference_type
Definition: PBoRiOutIter.h:49
BEGIN_NAMESPACE_PBORI
#define BEGIN_NAMESPACE_PBORI
Start project's namespace.
Definition: pbori_defs.h:74
polybori::PBoRiOutIter::data_type
DataType data_type
Data type.
Definition: PBoRiOutIter.h:35
polybori::PBoRiOutIter::rhs_type
RhsType rhs_type
Type of right-hand side.
Definition: PBoRiOutIter.h:38
polybori::PBoRiOutIter::operator=
self & operator=(rhs_type rhs)
Assignment of index calls for change of that index in the monomial.
Definition: PBoRiOutIter.h:78
polybori::PBoRiOutIter::operator++
self & operator++()
Prefix increment operator.
Definition: PBoRiOutIter.h:84
polybori::PBoRiOutIter::op
op_type op
Definition: PBoRiOutIter.h:91
polybori::PBoRiOutIter::~PBoRiOutIter
~PBoRiOutIter()
Destructor.
Definition: PBoRiOutIter.h:64
polybori::PBoRiOutIter::operator=
self & operator=(const self &rhs)
Assignment.
Definition: PBoRiOutIter.h:71
pbori_defs.h
polybori::PBoRiOutIter::reference
void reference
Definition: PBoRiOutIter.h:51
polybori::PBoRiOutIter::iterator_category
std::output_iterator_tag iterator_category
Definition: PBoRiOutIter.h:48
polybori::PBoRiOutIter::value_type
void value_type
Definition: PBoRiOutIter.h:52
polybori::PBoRiOutIter::PBoRiOutIter
PBoRiOutIter(const self &rhs)
Copy constructor.
Definition: PBoRiOutIter.h:60
polybori::PBoRiOutIter::operator++
self operator++(int)
Postfix increment operator.
Definition: PBoRiOutIter.h:87
polybori::PBoRiOutIter::pointer
void pointer
Definition: PBoRiOutIter.h:50
polybori::PBoRiOutIter
This template class defines an output iterator which interprets assignments of indices as a change of...
Definition: PBoRiOutIter.h:31