1 // Copyright Daniel Trebbien 2010.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or the copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #ifndef BOOST_GRAPH_BUFFER_CONCEPTS_HPP
7 #define BOOST_GRAPH_BUFFER_CONCEPTS_HPP 1
8 #include <boost/concept_check.hpp>
9 #include <boost/property_map/property_map.hpp>
10 #include <boost/typeof/typeof.hpp>
11 #include <boost/type_traits/add_const.hpp>
12 #include <boost/type_traits/add_reference.hpp>
13 #include <boost/type_traits/remove_reference.hpp>
15 #include <boost/concept/detail/concept_def.hpp>
19 BOOST_concept(Buffer, (B))
21 typedef typename B::value_type value_type;
22 typedef typename B::size_type size_type;
24 BOOST_CONCEPT_USAGE(Buffer)
26 typedef typename boost::add_reference< value_type >::type reference;
28 BOOST_CONCEPT_ASSERT((Assignable< value_type >));
32 reference t = buf.top();
33 boost::ignore_unused_variable_warning(t);
36 void const_constraints(const B& cbuf)
38 typedef typename boost::add_const<
39 typename boost::remove_reference< value_type >::type >::type&
42 const_reference ct = cbuf.top();
50 static const value_type g_ct;
55 BOOST_concept(UpdatableQueue, (Q)) : Buffer< Q >
57 BOOST_CONCEPT_USAGE(UpdatableQueue) { q.update(g_ct); }
59 void const_constraints(const Q& cq)
61 if (cq.contains(g_ct))
67 static const typename Buffer< Q >::value_type g_ct;
71 BOOST_concept(KeyedUpdatableQueue, (Q)) : UpdatableQueue< Q >
73 typedef typename Q::key_type key_type;
74 typedef typename Q::key_map key_map;
76 BOOST_CONCEPT_USAGE(KeyedUpdatableQueue)
78 BOOST_CONCEPT_ASSERT((boost::ReadWritePropertyMapConcept< key_map,
79 typename Buffer< Q >::value_type >));
82 void const_constraints(const Q& cq)
88 static const typename Buffer< Q >::value_type g_ct;
94 } // end `namespace boost`
95 #include <boost/concept/detail/concept_undef.hpp>
97 #endif // !BOOST_GRAPH_BUFFER_CONCEPTS_HPP