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>
18 BOOST_concept(Buffer, (B))
20 typedef typename B::value_type value_type;
21 typedef typename B::size_type size_type;
23 BOOST_CONCEPT_USAGE(Buffer) {
24 typedef typename boost::add_reference<value_type>::type reference;
26 BOOST_CONCEPT_ASSERT((Assignable<value_type>));
30 reference t = buf.top();
31 boost::ignore_unused_variable_warning(t);
34 void const_constraints(const B& cbuf) {
35 typedef typename boost::add_const<typename boost::remove_reference<value_type>::type>::type& const_reference;
37 const_reference ct = cbuf.top();
45 static const value_type g_ct;
50 BOOST_concept(UpdatableQueue, (Q))
53 BOOST_CONCEPT_USAGE(UpdatableQueue) {
57 void const_constraints(const Q& cq) {
58 if (cq.contains(g_ct))
64 static const typename Buffer<Q>::value_type g_ct;
68 BOOST_concept(KeyedUpdatableQueue, (Q))
71 typedef typename Q::key_type key_type;
72 typedef typename Q::key_map key_map;
74 BOOST_CONCEPT_USAGE(KeyedUpdatableQueue) {
75 BOOST_CONCEPT_ASSERT((boost::ReadWritePropertyMapConcept<key_map, typename Buffer<Q>::value_type>));
78 void const_constraints(const Q& cq) {
83 static const typename Buffer<Q>::value_type g_ct;
89 } // end `namespace boost`
90 #include <boost/concept/detail/concept_undef.hpp>
92 #endif // !BOOST_GRAPH_BUFFER_CONCEPTS_HPP