PageRenderTime 27ms CodeModel.GetById 19ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 1ms

/Src/Dependencies/Boost/boost/spirit/home/support/iterators/istream_iterator.hpp

http://hadesmem.googlecode.com/
C++ Header | 80 lines | 62 code | 12 blank | 6 comment | 1 complexity | e4e508f20875bddb3237512bdd2344c3 MD5 | raw file
 1//  Copyright (c) 2001-2011 Hartmut Kaiser
 2// 
 3//  Distributed under the Boost Software License, Version 1.0. (See accompanying
 4//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 5
 6#if !defined(BOOST_SPIRIT_ISTREAM_ITERATOR_JAN_03_2010_0522PM)
 7#define BOOST_SPIRIT_ISTREAM_ITERATOR_JAN_03_2010_0522PM
 8
 9#include <boost/spirit/home/support/iterators/detail/ref_counted_policy.hpp>
10#if defined(BOOST_SPIRIT_DEBUG)
11#include <boost/spirit/home/support/iterators/detail/buf_id_check_policy.hpp>
12#else
13#include <boost/spirit/home/support/iterators/detail/no_check_policy.hpp>
14#endif
15#include <boost/spirit/home/support/iterators/detail/istream_policy.hpp>
16#include <boost/spirit/home/support/iterators/detail/split_std_deque_policy.hpp>
17#include <boost/spirit/home/support/iterators/detail/combine_policies.hpp>
18#include <boost/spirit/home/support/iterators/multi_pass.hpp>
19
20namespace boost { namespace spirit 
21{
22    ///////////////////////////////////////////////////////////////////////////
23    template <typename Elem, typename Traits = std::char_traits<Elem> >
24    class basic_istream_iterator :
25        public multi_pass<
26            std::basic_istream<Elem, Traits>
27          , iterator_policies::default_policy<
28                iterator_policies::ref_counted
29#if defined(BOOST_SPIRIT_DEBUG)
30              , iterator_policies::buf_id_check
31#else
32              , iterator_policies::no_check
33#endif
34              , iterator_policies::istream
35              , iterator_policies::split_std_deque> 
36        >
37    {
38    private:
39        typedef multi_pass<
40            std::basic_istream<Elem, Traits>
41          , iterator_policies::default_policy<
42                iterator_policies::ref_counted
43#if defined(BOOST_SPIRIT_DEBUG)
44              , iterator_policies::buf_id_check
45#else
46              , iterator_policies::no_check
47#endif
48              , iterator_policies::istream
49              , iterator_policies::split_std_deque> 
50        > base_type;
51
52    public:
53        basic_istream_iterator()
54          : base_type() {}
55
56        explicit basic_istream_iterator(std::basic_istream<Elem, Traits>& x)
57          : base_type(x) {}
58
59        basic_istream_iterator(basic_istream_iterator const& x)
60          : base_type(x) {}
61
62#if BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
63        basic_istream_iterator(int)   // workaround for a bug in the library
64          : base_type() {}            // shipped with gcc 3.1
65#endif // BOOST_WORKAROUND(__GLIBCPP__, == 20020514)
66
67        basic_istream_iterator operator= (base_type const& rhs)
68        {
69            this->base_type::operator=(rhs);
70            return *this;
71        }
72
73    // default generated operators, destructor and assignment operator are ok.
74    };
75
76    typedef basic_istream_iterator<char> istream_iterator;
77
78}}
79
80#endif