1 #ifndef BOOST_ARCHIVE_ITERATORS_DATAFLOW_HPP
2 #define BOOST_ARCHIVE_ITERATORS_DATAFLOW_HPP
4 // MS compatible compilers support #pragma once
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/assert.hpp>
21 #include <boost/mpl/eval_if.hpp>
22 #include <boost/mpl/if.hpp>
23 #include <boost/mpl/apply.hpp>
24 #include <boost/mpl/plus.hpp>
25 #include <boost/mpl/int.hpp>
27 #include <boost/type_traits/is_convertible.hpp>
28 #include <boost/type_traits/is_base_and_derived.hpp>
29 #include <boost/type_traits/is_pointer.hpp>
30 #include <boost/iterator/iterator_adaptor.hpp>
31 #include <boost/iterator/iterator_traits.hpp>
32 #include <boost/static_assert.hpp>
38 // poor man's tri-state
47 BOOST_ASSERT(is_indeterminant != m_state);
48 return is_true == m_state ? true : false;
51 tri_state & operator=(bool rhs) {
52 m_state = rhs ? is_true : is_false;
56 m_state(rhs ? is_true : is_false)
58 tri_state(state_enum state) :
61 bool operator==(const tri_state & rhs) const {
62 return m_state == rhs.m_state;
64 bool operator!=(const tri_state & rhs) const {
65 return m_state != rhs.m_state;
69 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
70 // implement functions common to dataflow iterators
71 template<class Derived>
75 // test for iterator equality
76 tri_state equal(const Derived & rhs) const {
77 if(m_eoi && rhs.m_eoi)
79 if(m_eoi || rhs.m_eoi)
81 return tri_state(tri_state::is_indeterminant);
93 dataflow() : // used for iterator end
98 } // namespace iterators
99 } // namespace archive
102 #endif // BOOST_ARCHIVE_ITERATORS_DATAFLOW_HPP