File indexing completed on 2025-01-31 10:01:52
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_SPIRIT_ACTOR_PUSH_BACK_ACTOR_HPP
0009 #define BOOST_SPIRIT_ACTOR_PUSH_BACK_ACTOR_HPP
0010
0011 #include <boost/spirit/home/classic/namespace.hpp>
0012 #include <boost/spirit/home/classic/actor/ref_value_actor.hpp>
0013 #include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp>
0014
0015 namespace boost { namespace spirit {
0016
0017 BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042 struct push_back_action
0043 {
0044 template<
0045 typename T,
0046 typename ValueT
0047 >
0048 void act(T& ref_, ValueT const& value_) const
0049 {
0050 ref_.push_back( value_ );
0051 }
0052 template<
0053 typename T,
0054 typename IteratorT
0055 >
0056 void act(
0057 T& ref_,
0058 IteratorT const& first_,
0059 IteratorT const& last_
0060 ) const
0061 {
0062 typedef typename T::value_type value_type;
0063 value_type value(first_,last_);
0064
0065 ref_.push_back( value );
0066 }
0067 };
0068
0069
0070 template<typename T>
0071 inline ref_value_actor<T,push_back_action>
0072 append(T& ref_)
0073 {
0074 return ref_value_actor<T,push_back_action>(ref_);
0075 }
0076
0077 template<typename T>
0078 inline ref_value_actor<T,push_back_action>
0079 push_back_a(T& ref_)
0080 {
0081 return ref_value_actor<T,push_back_action>(ref_);
0082 }
0083
0084 template<
0085 typename T,
0086 typename ValueT
0087 >
0088 inline ref_const_ref_actor<T,ValueT,push_back_action>
0089 push_back_a(
0090 T& ref_,
0091 ValueT const& value_
0092 )
0093 {
0094 return ref_const_ref_actor<T,ValueT,push_back_action>(ref_,value_);
0095 }
0096
0097 BOOST_SPIRIT_CLASSIC_NAMESPACE_END
0098
0099 }}
0100
0101 #endif