]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/include/boost/spirit/home/support/iterators/detail/multi_pass.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / spirit / include / boost / spirit / home / support / iterators / detail / multi_pass.hpp
1 // Copyright (c) 2001 Daniel C. Nuffer
2 // Copyright (c) 2001-2011 Hartmut Kaiser
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 #if !defined(BOOST_SPIRIT_ITERATOR_MULTI_PASS_MAR_16_2007_1122AM)
8 #define BOOST_SPIRIT_ITERATOR_MULTI_PASS_MAR_16_2007_1122AM
9
10 #include <boost/config.hpp>
11 #include <boost/spirit/home/support/iterators/multi_pass_fwd.hpp>
12 #include <boost/iterator.hpp>
13 #include <boost/mpl/bool.hpp>
14 #include <iterator>
15 #include <algorithm>
16
17 ///////////////////////////////////////////////////////////////////////////////
18 namespace boost { namespace spirit { namespace detail
19 {
20
21 ///////////////////////////////////////////////////////////////////////////
22 // Default implementations of the different policies to be used with a
23 // multi_pass iterator
24 ///////////////////////////////////////////////////////////////////////////
25 struct default_input_policy
26 {
27 default_input_policy() {}
28
29 template <typename Functor>
30 default_input_policy(Functor const&) {}
31
32 template <typename MultiPass>
33 static void destroy(MultiPass&) {}
34
35 void swap(default_input_policy&) {}
36
37 template <typename MultiPass, typename TokenType>
38 static void advance_input(MultiPass& mp);
39
40 template <typename MultiPass>
41 static typename MultiPass::reference get_input(MultiPass& mp);
42
43 template <typename MultiPass>
44 static bool input_at_eof(MultiPass const& mp);
45
46 template <typename MultiPass, typename TokenType>
47 static bool input_is_valid(MultiPass& mp, TokenType& curtok);
48 };
49
50 struct default_ownership_policy
51 {
52 template <typename MultiPass>
53 static void destroy(MultiPass&) {}
54
55 void swap(default_ownership_policy&) {}
56
57 template <typename MultiPass>
58 static void clone(MultiPass&) {}
59
60 template <typename MultiPass>
61 static bool release(MultiPass& mp);
62
63 template <typename MultiPass>
64 static bool is_unique(MultiPass const& mp);
65 };
66
67 struct default_storage_policy
68 {
69 template <typename MultiPass>
70 static void destroy(MultiPass&) {}
71
72 void swap(default_storage_policy&) {}
73
74 template <typename MultiPass>
75 static typename MultiPass::reference dereference(MultiPass const& mp);
76
77 template <typename MultiPass>
78 static void increment(MultiPass&) {}
79
80 template <typename MultiPass>
81 static void clear_queue(MultiPass&) {}
82
83 template <typename MultiPass>
84 static bool is_eof(MultiPass const& mp);
85
86 template <typename MultiPass>
87 static bool equal_to(MultiPass const& mp, MultiPass const& x);
88
89 template <typename MultiPass>
90 static bool less_than(MultiPass const& mp, MultiPass const& x);
91 };
92
93 struct default_checking_policy
94 {
95 template <typename MultiPass>
96 static void destroy(MultiPass&) {}
97
98 void swap(default_checking_policy&) {}
99
100 template <typename MultiPass>
101 static void docheck(MultiPass const&) {}
102
103 template <typename MultiPass>
104 static void clear_queue(MultiPass&) {}
105 };
106
107 }}}
108
109 #endif