|
||||
File indexing completed on 2025-01-31 10:01:52
0001 /*============================================================================= 0002 Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) 0003 http://spirit.sourceforge.net/ 0004 0005 Distributed under the Boost Software License, Version 1.0. (See accompanying 0006 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 0007 =============================================================================*/ 0008 #ifndef BOOST_SPIRIT_ACTOR_REF_CONST_REF_ACTOR_HPP 0009 #define BOOST_SPIRIT_ACTOR_REF_CONST_REF_ACTOR_HPP 0010 0011 #include <boost/spirit/home/classic/namespace.hpp> 0012 0013 namespace boost { namespace spirit { 0014 0015 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN 0016 0017 /////////////////////////////////////////////////////////////////////////// 0018 // Summary: 0019 // A semantic action policy holder. This holder stores a reference to ref 0020 // and a const reference to value_ref. 0021 // act methods are feed with ref and value_ref. The parse result is 0022 // not used by this holder. 0023 // 0024 // (This doc uses convention available in actors.hpp) 0025 // 0026 // Constructor: 0027 // ...(T& ref_, ValueT const& value_ref_); 0028 // where ref_ and value_ref_ are stored in the holder. 0029 // 0030 // Action calls: 0031 // act(ref, value_ref); 0032 // 0033 // () operators: both 0034 // 0035 /////////////////////////////////////////////////////////////////////////// 0036 template< 0037 typename T, 0038 typename ValueT, 0039 typename ActionT 0040 > 0041 class ref_const_ref_actor : public ActionT 0042 { 0043 private: 0044 T& ref; 0045 ValueT const& value_ref; 0046 public: 0047 ref_const_ref_actor( 0048 T& ref_, 0049 ValueT const& value_ref_ 0050 ) 0051 : 0052 ref(ref_), 0053 value_ref(value_ref_) 0054 {} 0055 0056 0057 template<typename T2> 0058 void operator()(T2 const& /*val*/) const 0059 { 0060 this->act(ref,value_ref); // defined in ActionT 0061 } 0062 0063 0064 template<typename IteratorT> 0065 void operator()( 0066 IteratorT const& /*first*/, 0067 IteratorT const& /*last*/ 0068 ) const 0069 { 0070 this->act(ref,value_ref); // defined in ActionT 0071 } 0072 }; 0073 0074 BOOST_SPIRIT_CLASSIC_NAMESPACE_END 0075 0076 }} 0077 0078 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |