Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:01:52

0001 /*=============================================================================
0002     Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com)
0003     Copyright (c) 2011 Bryce Lelbach
0004     http://spirit.sourceforge.net/
0005 
0006   Distributed under the Boost Software License, Version 1.0. (See accompanying
0007   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 =============================================================================*/
0009 #ifndef BOOST_SPIRIT_ACTOR_REF_VALUE_ACTOR_HPP
0010 #define BOOST_SPIRIT_ACTOR_REF_VALUE_ACTOR_HPP
0011 
0012 #include <boost/detail/workaround.hpp>
0013 
0014 #include <boost/spirit/home/classic/namespace.hpp>
0015 
0016 namespace boost { namespace spirit {
0017 
0018 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
0019 
0020 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
0021 #pragma warning(push)
0022 #pragma warning(disable:4512) //assignment operator could not be generated
0023 #endif
0024 
0025     ///////////////////////////////////////////////////////////////////////////
0026     //  Summary:
0027     //  A semantic action policy holder. This holder stores a reference to ref.
0028     //  act methods are feed with ref and the parse result.
0029     //
0030     //  (This doc uses convention available in actors.hpp)
0031     //
0032     //  Constructor:
0033     //      ...(T& ref_);
0034     //      where ref_ is stored.
0035     //
0036     //  Action calls:
0037     //      act(ref, value);
0038     //      act(ref, first,last);
0039     //
0040     //  () operators: both
0041     //
0042     ///////////////////////////////////////////////////////////////////////////
0043     template<
0044         typename T,
0045         typename ActionT
0046     >
0047     class ref_value_actor : public ActionT
0048     {
0049     private:
0050         T& ref;
0051     public:
0052         explicit
0053         ref_value_actor(T& ref_)
0054         : ref(ref_){}
0055 
0056 
0057         template<typename T2>
0058         void operator()(T2 const& val_) const
0059         {
0060             this->act(ref,val_); // 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,first_,last_); // defined in ActionT
0071         }
0072     };
0073 
0074 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0075 
0076 #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
0077 #pragma warning(pop)
0078 #endif
0079 
0080 }}
0081 
0082 #endif