File indexing completed on 2025-01-19 09:47:40
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_SPIRIT_GENERATOR_JANUARY_13_2009_1002AM)
0008 #define BOOST_SPIRIT_GENERATOR_JANUARY_13_2009_1002AM
0009
0010 #if defined(_MSC_VER)
0011 #pragma once
0012 #endif
0013
0014 #include <boost/mpl/has_xxx.hpp>
0015 #include <boost/mpl/int.hpp>
0016 #include <boost/spirit/home/karma/domain.hpp>
0017
0018 namespace boost { namespace spirit { namespace karma
0019 {
0020 struct generator_properties
0021 {
0022 enum enum_type {
0023 no_properties = 0,
0024 buffering = 0x01,
0025 counting = 0x02,
0026 tracking = 0x04,
0027 disabling = 0x08,
0028
0029 countingbuffer = 0x03,
0030 all_properties = 0x0f
0031 };
0032 };
0033
0034 template <typename Derived>
0035 struct generator
0036 {
0037 struct generator_id;
0038 typedef mpl::int_<generator_properties::no_properties> properties;
0039 typedef Derived derived_type;
0040 typedef karma::domain domain;
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061 Derived const& derived() const
0062 {
0063 return *static_cast<Derived const*>(this);
0064 }
0065 };
0066
0067 template <typename Derived>
0068 struct primitive_generator : generator<Derived>
0069 {
0070 struct primitive_generator_id;
0071 };
0072
0073 template <typename Derived>
0074 struct nary_generator : generator<Derived>
0075 {
0076 struct nary_generator_id;
0077
0078
0079
0080
0081
0082
0083
0084
0085 };
0086
0087 template <typename Derived>
0088 struct unary_generator : generator<Derived>
0089 {
0090 struct unary_generator_id;
0091
0092
0093
0094
0095
0096
0097
0098
0099 };
0100
0101 template <typename Derived>
0102 struct binary_generator : generator<Derived>
0103 {
0104 struct binary_generator_id;
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121 };
0122
0123 }}}
0124
0125 namespace boost { namespace spirit { namespace traits
0126 {
0127 namespace detail
0128 {
0129
0130 BOOST_MPL_HAS_XXX_TRAIT_DEF(generator_id)
0131 BOOST_MPL_HAS_XXX_TRAIT_DEF(primitive_generator_id)
0132 BOOST_MPL_HAS_XXX_TRAIT_DEF(nary_generator_id)
0133 BOOST_MPL_HAS_XXX_TRAIT_DEF(unary_generator_id)
0134 BOOST_MPL_HAS_XXX_TRAIT_DEF(binary_generator_id)
0135 }
0136
0137
0138 template <typename T>
0139 struct is_generator : detail::has_generator_id<T> {};
0140
0141 template <typename T>
0142 struct is_primitive_generator : detail::has_primitive_generator_id<T> {};
0143
0144 template <typename T>
0145 struct is_nary_generator : detail::has_nary_generator_id<T> {};
0146
0147 template <typename T>
0148 struct is_unary_generator : detail::has_unary_generator_id<T> {};
0149
0150 template <typename T>
0151 struct is_binary_generator : detail::has_binary_generator_id<T> {};
0152
0153
0154 template <typename T>
0155 struct properties_of : T::properties {};
0156
0157 }}}
0158
0159 #endif