Chris@16
|
1 // Boost.Bimap
|
Chris@16
|
2 //
|
Chris@16
|
3 // Copyright (c) 2006-2007 Matias Capeletto
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8
|
Chris@16
|
9 /// \file relation/support/pair_by.hpp
|
Chris@16
|
10 /// \brief pair_by<member>(r) function
|
Chris@16
|
11
|
Chris@16
|
12 #ifndef BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP
|
Chris@16
|
13 #define BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP
|
Chris@16
|
14
|
Chris@101
|
15 #if defined(_MSC_VER)
|
Chris@16
|
16 #pragma once
|
Chris@16
|
17 #endif
|
Chris@16
|
18
|
Chris@16
|
19 #include <boost/config.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #include <boost/bimap/relation/support/pair_type_by.hpp>
|
Chris@16
|
22 #include <boost/bimap/relation/detail/access_builder.hpp>
|
Chris@16
|
23
|
Chris@16
|
24 #ifdef BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
|
Chris@16
|
25
|
Chris@16
|
26 namespace boost {
|
Chris@16
|
27 namespace bimaps {
|
Chris@16
|
28 namespace relation {
|
Chris@16
|
29 namespace support {
|
Chris@16
|
30
|
Chris@16
|
31 /** \brief Gets a pair view of the relation.
|
Chris@16
|
32
|
Chris@16
|
33 \ingroup relation_group
|
Chris@16
|
34 **/
|
Chris@16
|
35
|
Chris@16
|
36 template< class Tag, class Relation >
|
Chris@16
|
37 BOOST_DEDUCED_TYPENAME result_of::pair_by<Tag,Relation>::type
|
Chris@16
|
38 pair_by( Relation & rel );
|
Chris@16
|
39
|
Chris@16
|
40 } // namespace support
|
Chris@16
|
41 } // namespace relation
|
Chris@16
|
42 } // namespace bimaps
|
Chris@16
|
43 } // namespace boost
|
Chris@16
|
44
|
Chris@16
|
45 #endif // BOOST_BIMAP_ONLY_DOXYGEN_WILL_PROCESS_THE_FOLLOWING_LINES
|
Chris@16
|
46
|
Chris@16
|
47
|
Chris@16
|
48 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
|
Chris@16
|
49
|
Chris@16
|
50 namespace boost {
|
Chris@16
|
51 namespace bimaps {
|
Chris@16
|
52 namespace relation {
|
Chris@16
|
53 namespace support {
|
Chris@16
|
54
|
Chris@16
|
55
|
Chris@16
|
56 // Since it is very error-prone to directly write the hole bunch
|
Chris@16
|
57 // of relation accesor. They are buil from litle macro blocks that
|
Chris@16
|
58 // are both more readable, leading to self docummenting code and a
|
Chris@16
|
59 // lot more easier to understand and mantain.
|
Chris@16
|
60 // It is very important to note that the three building blocks have
|
Chris@16
|
61 // to laid in the same namespace in order to work. There is also
|
Chris@16
|
62 // important to keep them in order.
|
Chris@16
|
63 // The forward declaration are not necesary but they help a lot to
|
Chris@16
|
64 // the reader, as they undercover what is the signature of the
|
Chris@16
|
65 // result code.
|
Chris@16
|
66 // In the end, it is not quicker to do it in this way because you
|
Chris@16
|
67 // write a lot. But this code has no complexity at all and almost
|
Chris@16
|
68 // every word writed is for documentation.
|
Chris@16
|
69
|
Chris@16
|
70 // Result of
|
Chris@16
|
71 // -------------------------------------------------------------------------
|
Chris@16
|
72 /*
|
Chris@16
|
73 namespace result_of {
|
Chris@16
|
74
|
Chris@16
|
75 template< class Tag, class Relation >
|
Chris@16
|
76 struct pair_by<Tag,Relation>;
|
Chris@16
|
77 {
|
Chris@16
|
78 typedef -unspecified- type;
|
Chris@16
|
79 };
|
Chris@16
|
80
|
Chris@16
|
81 } // namespace result_of
|
Chris@16
|
82 */
|
Chris@16
|
83
|
Chris@16
|
84 BOOST_BIMAP_SYMMETRIC_ACCESS_RESULT_OF_BUILDER
|
Chris@16
|
85 (
|
Chris@16
|
86 pair_by,
|
Chris@16
|
87 pair_type_by
|
Chris@16
|
88 )
|
Chris@16
|
89
|
Chris@16
|
90
|
Chris@16
|
91
|
Chris@16
|
92 // Implementation
|
Chris@16
|
93 // -------------------------------------------------------------------------
|
Chris@16
|
94
|
Chris@16
|
95 BOOST_BIMAP_SYMMETRIC_ACCESS_IMPLEMENTATION_BUILDER
|
Chris@16
|
96 (
|
Chris@16
|
97 pair_by,
|
Chris@16
|
98 Relation,
|
Chris@16
|
99 rel,
|
Chris@16
|
100 return rel.get_left_pair(),
|
Chris@16
|
101 return rel.get_right_pair()
|
Chris@16
|
102 )
|
Chris@16
|
103
|
Chris@16
|
104 // Interface
|
Chris@16
|
105 // --------------------------------------------------------------------------
|
Chris@16
|
106
|
Chris@16
|
107 BOOST_BIMAP_SYMMETRIC_ACCESS_INTERFACE_BUILDER
|
Chris@16
|
108 (
|
Chris@16
|
109 pair_by
|
Chris@16
|
110 )
|
Chris@16
|
111
|
Chris@16
|
112 } // namespace support
|
Chris@16
|
113 } // namespace relation
|
Chris@16
|
114 } // namespace bimaps
|
Chris@16
|
115 } // namespace boost
|
Chris@16
|
116
|
Chris@16
|
117
|
Chris@16
|
118 #endif // BOOST_BIMAP_DOXIGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
|
Chris@16
|
119
|
Chris@16
|
120 #endif // BOOST_BIMAP_RELATION_SUPPORT_PAIR_BY_HPP
|