PolyBoRi
|
00001 // -*- c++ -*- 00002 //***************************************************************************** 00036 //***************************************************************************** 00037 00038 // include basic definitions 00039 #include "pbori_defs.h" 00040 00041 #ifndef PBoRiOutIter_h_ 00042 #define PBoRiOutIter_h_ 00043 00044 BEGIN_NAMESPACE_PBORI 00045 00053 template <class DataType, class RhsType, class BinOp> 00054 class PBoRiOutIter { 00055 public: 00056 00058 typedef DataType data_type; 00059 00061 typedef RhsType rhs_type; 00062 00064 typedef BinOp op_type; 00065 00067 typedef PBoRiOutIter<data_type, rhs_type, op_type> self; 00068 00070 00071 typedef std::output_iterator_tag iterator_category; 00072 typedef void difference_type; 00073 typedef void pointer; 00074 typedef void reference; 00075 typedef void value_type; 00077 00079 PBoRiOutIter(data_type& data_, op_type op_ = op_type()): 00080 data(data_), op(op_) {} 00081 00083 PBoRiOutIter(const self& rhs): 00084 data(rhs.data), op(rhs.op) {} 00085 00087 ~PBoRiOutIter() {} 00088 00091 self& operator*() { return *this; } 00092 00094 self& operator=(const self& rhs) { 00095 data = rhs.data; 00096 op = rhs.op; 00097 return *this; 00098 } 00099 00101 self& operator=(rhs_type rhs){ 00102 op(data, rhs); 00103 return *this; 00104 } 00105 00107 self& operator++() { return *this; } 00108 00110 self operator++(int) { return *this; } 00111 00112 protected: 00113 data_type& data; 00114 op_type op; 00115 }; 00116 00117 00118 END_NAMESPACE_PBORI 00119 00120 #endif