Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-27 09:54:58

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_ACTOR_HPP
0009 #define BOOST_SPIRIT_ACTOR_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     //  act methods are fead with this reference. The parse result is not used
0021     //  by this holder.
0022     //
0023     //  (This doc uses convention available in actors.hpp)
0024     //
0025     //  Constructor:
0026     //      ...(T& ref_);
0027     //      where ref_ is stored.
0028     //
0029     //  Action calls:
0030     //      act(ref);
0031     //
0032     //  () operators: both
0033     //
0034     ///////////////////////////////////////////////////////////////////////////
0035     template<
0036         typename T,
0037         typename ActionT
0038     >
0039     class ref_actor : public ActionT
0040     {
0041     private:
0042         T& ref;
0043     public:
0044         explicit
0045         ref_actor(T& ref_)
0046         : ref(ref_){}
0047 
0048 
0049         template<typename T2>
0050         void operator()(T2 const& /*val*/) const
0051         {
0052             this->act(ref); // defined in ActionT
0053         }
0054 
0055 
0056         template<typename IteratorT>
0057         void operator()(
0058             IteratorT const& /*first*/,
0059             IteratorT const& /*last*/
0060             ) const
0061         {
0062             this->act(ref); // defined in ActionT
0063         }
0064     };
0065 
0066 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0067 
0068 }}
0069 
0070 #endif