]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/include/boost/spirit/home/classic/actor/ref_actor.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / spirit / include / boost / spirit / home / classic / actor / ref_actor.hpp
1 /*=============================================================================
2 Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com)
3 http://spirit.sourceforge.net/
4
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
8 #ifndef BOOST_SPIRIT_ACTOR_REF_ACTOR_HPP
9 #define BOOST_SPIRIT_ACTOR_REF_ACTOR_HPP
10
11 #include <boost/spirit/home/classic/namespace.hpp>
12
13 namespace boost { namespace spirit {
14
15 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
16
17 ///////////////////////////////////////////////////////////////////////////
18 // Summary:
19 // A semantic action policy holder. This holder stores a reference to ref,
20 // act methods are fead with this reference. The parse result is not used
21 // by this holder.
22 //
23 // (This doc uses convention available in actors.hpp)
24 //
25 // Constructor:
26 // ...(T& ref_);
27 // where ref_ is stored.
28 //
29 // Action calls:
30 // act(ref);
31 //
32 // () operators: both
33 //
34 ///////////////////////////////////////////////////////////////////////////
35 template<
36 typename T,
37 typename ActionT
38 >
39 class ref_actor : public ActionT
40 {
41 private:
42 T& ref;
43 public:
44 explicit
45 ref_actor(T& ref_)
46 : ref(ref_){}
47
48
49 template<typename T2>
50 void operator()(T2 const& /*val*/) const
51 {
52 this->act(ref); // defined in ActionT
53 }
54
55
56 template<typename IteratorT>
57 void operator()(
58 IteratorT const& /*first*/,
59 IteratorT const& /*last*/
60 ) const
61 {
62 this->act(ref); // defined in ActionT
63 }
64 };
65
66 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
67
68 }}
69
70 #endif