00001 // -*- c++ -*- 00002 //***************************************************************************** 00033 //***************************************************************************** 00034 00035 // include basic definitions 00036 #include "pbori_defs.h" 00037 00038 #ifndef PBoRiOutIter_h_ 00039 #define PBoRiOutIter_h_ 00040 00041 BEGIN_NAMESPACE_PBORI 00042 00050 template <class DataType, class RhsType, class BinOp> 00051 class PBoRiOutIter { 00052 public: 00053 00055 typedef DataType data_type; 00056 00058 typedef RhsType rhs_type; 00059 00061 typedef BinOp op_type; 00062 00064 typedef PBoRiOutIter<data_type, rhs_type, op_type> self; 00065 00067 00068 typedef std::output_iterator_tag iterator_category; 00069 typedef void difference_type; 00070 typedef void pointer; 00071 typedef void reference; 00072 typedef void value_type; 00074 00076 PBoRiOutIter(data_type& data_, op_type op_ = op_type()): 00077 data(data_), op(op_) {} 00078 00080 PBoRiOutIter(const self& rhs): 00081 data(rhs.data), op(rhs.op) {} 00082 00084 ~PBoRiOutIter() {} 00085 00088 self& operator*() { return *this; } 00089 00091 self& operator=(const self& rhs) { 00092 data = rhs.data; 00093 op = rhs.op; 00094 return *this; 00095 } 00096 00098 self& operator=(rhs_type rhs){ 00099 op(data, rhs); 00100 return *this; 00101 } 00102 00104 self& operator++() { return *this; } 00105 00107 self operator++(int) { return *this; } 00108 00109 protected: 00110 data_type& data; 00111 op_type op; 00112 }; 00113 00114 00115 END_NAMESPACE_PBORI 00116 00117 #endif