3 // Copyright (c) 2006-2007 Matias Capeletto
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 /// \file relation/support/data_extractor.hpp
10 /// \brief Data extraction functor.
12 #ifndef BOOST_BIMAP_RELATION_SUPPORT_DATA_EXTRACTOR_HPP
13 #define BOOST_BIMAP_RELATION_SUPPORT_DATA_EXTRACTOR_HPP
15 #if defined(_MSC_VER) && (_MSC_VER>=1200)
19 #include <boost/config.hpp>
21 #include <boost/bimap/relation/detail/metadata_access_builder.hpp>
23 /** \struct boost::bimaps::relation::support::data_extractor
25 \brief Data extraction functor.
27 \ingroup relation_group
30 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
37 template< class Tag, class Relation >
38 struct data_extractor_implementation;
40 template< class Relation >
41 struct data_extractor_implementation< member_at::left, Relation > :
42 public std::unary_function<Relation,BOOST_DEDUCED_TYPENAME Relation::left_value_type>
44 BOOST_DEDUCED_TYPENAME Relation::left_value_type const &
45 operator()(Relation const & rel) const
50 BOOST_DEDUCED_TYPENAME Relation::left_value_type &
51 operator()(Relation & rel) const
57 template< class Relation >
58 struct data_extractor_implementation< member_at::right, Relation > :
59 public std::unary_function<Relation,BOOST_DEDUCED_TYPENAME Relation::right_value_type>
61 BOOST_DEDUCED_TYPENAME Relation::right_value_type const &
62 operator()(Relation const & rel) const
67 BOOST_DEDUCED_TYPENAME Relation::right_value_type &
68 operator()(Relation & rel) const
74 template< class Tag, class Relation >
77 typedef data_extractor_implementation
79 BOOST_DEDUCED_TYPENAME member_with_tag<Tag,Relation>::type,
85 template< class Relation >
86 struct both_keys_extractor
88 typedef BOOST_DEDUCED_TYPENAME Relation::storage_base result_type;
90 const result_type & operator()(const Relation & rel) const
95 result_type & operator()( Relation & rel) const
101 } // namespace support
102 } // namespace relation
103 } // namespace bimaps
106 #endif // BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
108 #endif // BOOST_BIMAP_RELATION_SUPPORT_DATA_EXTRACTOR_HPP