--- /dev/null
+// Roast+ License
+
+/*
+
+*/
+#ifndef __SFJP_ROAST__container__random_number_iterator_HPP__
+#define __SFJP_ROAST__container__random_number_iterator_HPP__
+
+#include "roast/container/iterator_base.hpp"
+
+namespace roast
+{
+ /////////////////////////////////////////////////////////
+
+ // !! Not Implemented is_valid() Method. !!
+
+ template <typename T, typename _RandomProc>
+ class _random_number_iterator_impl
+ {
+ public:
+ typedef T IteratorType;
+
+ typedef T ValueType;
+ typedef T ValueTypeRef;
+ typedef T* ValueTypePtr;
+ typedef const T CValueType;
+ typedef const T CValueTypeRef;
+ typedef const T* CValueTypePtr;
+ protected:
+ _RandomProc m_it;
+
+ public:
+ _linear_iterator_impl_base(){}
+ _linear_iterator_impl_base(const T& _beg)
+ : m_it(_beg)
+ {}
+ ///////////////////////////////////////////////////////////////////////
+
+ void setup(const T& _beg)
+ {
+ m_it = _beg;
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+
+ int compare(const _random_number_iterator_impl& target) const
+ {
+ //return m_it - target.m_it;
+ return 0;
+ }
+
+ // Next (Like iterator ++)
+ void next() {
+ m_it++;
+ }
+
+ // Value
+ //T& get_value_ref() const
+ T get_value_ref() const
+ {
+ return m_it;
+ }
+ };
+
+ ///////////////////////////////////////////////////////////
+
+ template <typename T>
+ class _linear_reverse_iterator_impl_base :
+ public _linear_iterator_impl_base<T>
+ {
+ private:
+ typedef _linear_iterator_impl_base<T> _Base;
+ public:
+ _linear_reverse_iterator_impl_base(){}
+ _linear_reverse_iterator_impl_base(const T& _beg)
+ : _Base(_beg)
+ {}
+ ///////////////////////////////////////////////////////////////////////
+
+ // Next (Like iterator ++)
+ void next() {
+ m_it--;
+ }
+ };
+
+ /////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////
+
+ template <typename _ImplBase>
+ class _linear_iterator_arithmetic : public _ImplBase
+ {
+ private:
+ typedef _ImplBase _Base;
+ typedef _linear_iterator_arithmetic<_Base> _Self;
+ typedef typename _Base::IteratorType IteratorType;
+ public:
+ _linear_iterator_arithmetic(){}
+ _linear_iterator_arithmetic(const _ImplBase& _impl) : _Base(_impl){}
+ _linear_iterator_arithmetic(const IteratorType& _it) : _Base(_it){}
+
+ ///////////////////////////////////////////////////////////////////////
+
+ // Arithmetic operators
+
+ int operator -(const _Self& target) const
+ {
+ return m_it - target.m_it;
+ }
+ int operator -(const IteratorType& target) const
+ {
+ return m_it - target;
+ }
+ _Self operator -(int n) const
+ {
+ _Self work = *this;
+ work.m_it -= n;
+ return work;
+ }
+ _Self operator --() {
+ _Self old = *this;
+ m_it--;
+ return old;
+ }
+ _Self operator --(int) {
+ m_it--;
+ return *this;
+ }
+
+ _Self operator +(int n) const
+ {
+ _Self work = *this;
+ work.m_it += n;
+ return work;
+ }
+ };
+
+ /////////////////////////////////////////////////////////
+
+ template <typename T>
+ class linear_iterator_base :
+ public _iterator< _linear_iterator_impl_base<T> >
+ {
+ private:
+ typedef _linear_iterator_impl_base<T> _Impl;
+ typedef _iterator<_Impl> _Base;
+ public:
+ linear_iterator_base(){}
+ linear_iterator_base(const _Impl& impl) : _Base(impl){}
+ linear_iterator_base(const T& length)
+ : _Base(_Impl(length)) {}
+ };
+}
+
+#endif//__SFJP_ROAST__container__random_number_iterator_HPP__