File indexing completed on 2025-01-18 09:53:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #if !defined(BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
0012 #define BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED
0013
0014 #include <map>
0015
0016 #include <boost/wave/wave_config.hpp>
0017 #include <boost/intrusive_ptr.hpp>
0018
0019 #if BOOST_WAVE_SERIALIZATION != 0
0020 #include <boost/serialization/serialization.hpp>
0021 #include <boost/serialization/map.hpp>
0022 #include <boost/shared_ptr.hpp>
0023 #else
0024 #include <boost/intrusive_ptr.hpp>
0025 #endif
0026
0027 #include <boost/iterator/transform_iterator.hpp>
0028
0029
0030 #ifdef BOOST_HAS_ABI_HEADERS
0031 #include BOOST_ABI_PREFIX
0032 #endif
0033
0034
0035 namespace boost {
0036 namespace wave {
0037 namespace util {
0038
0039
0040
0041
0042
0043
0044
0045 template <typename StringT, typename MacroDefT>
0046 struct symbol_table
0047 #if BOOST_WAVE_SERIALIZATION != 0
0048 : public std::map<StringT, boost::shared_ptr<MacroDefT> >
0049 #else
0050 : public std::map<StringT, boost::intrusive_ptr<MacroDefT> >
0051 #endif
0052 {
0053 #if BOOST_WAVE_SERIALIZATION != 0
0054 typedef std::map<StringT, boost::shared_ptr<MacroDefT> > base_type;
0055 #else
0056 typedef std::map<StringT, boost::intrusive_ptr<MacroDefT> > base_type;
0057 #endif
0058 typedef typename base_type::iterator iterator_type;
0059 typedef typename base_type::const_iterator const_iterator_type;
0060
0061 symbol_table(long uid_ = 0)
0062 {}
0063
0064 #if BOOST_WAVE_SERIALIZATION != 0
0065 private:
0066 friend class boost::serialization::access;
0067 template<typename Archive>
0068 void serialize(Archive &ar, const unsigned int version)
0069 {
0070 using namespace boost::serialization;
0071 ar & make_nvp("symbol_table",
0072 boost::serialization::base_object<base_type>(*this));
0073 }
0074 #endif
0075
0076 private:
0077
0078
0079
0080
0081
0082
0083 template <typename StringT1>
0084 struct get_first
0085 {
0086 typedef StringT1 const& result_type;
0087
0088 template <typename First, typename Second>
0089 StringT1 const& operator() (std::pair<First, Second> const& p) const
0090 {
0091 return p.first;
0092 }
0093 };
0094 typedef get_first<StringT> unary_functor;
0095
0096 public:
0097 typedef transform_iterator<unary_functor, iterator_type>
0098 name_iterator;
0099 typedef transform_iterator<unary_functor, const_iterator_type>
0100 const_name_iterator;
0101
0102 template <typename Iterator>
0103 static
0104 transform_iterator<unary_functor, Iterator> make_iterator(Iterator it)
0105 {
0106 return boost::make_transform_iterator<unary_functor>(it);
0107 }
0108 };
0109
0110
0111 }
0112 }
0113 }
0114
0115
0116 #ifdef BOOST_HAS_ABI_HEADERS
0117 #include BOOST_ABI_SUFFIX
0118 #endif
0119
0120 #endif