Chris@16
|
1 // Circular buffer library header file.
|
Chris@16
|
2
|
Chris@16
|
3 // Copyright (c) 2003-2008 Jan Gaspar
|
Chris@16
|
4
|
Chris@16
|
5 // Use, modification, and distribution is subject to the Boost Software
|
Chris@16
|
6 // License, Version 1.0. (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 // See www.boost.org/libs/circular_buffer for documentation.
|
Chris@16
|
10
|
Chris@16
|
11 #if !defined(BOOST_CIRCULAR_BUFFER_HPP)
|
Chris@16
|
12 #define BOOST_CIRCULAR_BUFFER_HPP
|
Chris@16
|
13
|
Chris@101
|
14 #if defined(_MSC_VER)
|
Chris@16
|
15 #pragma once
|
Chris@16
|
16 #endif
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/circular_buffer_fwd.hpp>
|
Chris@16
|
19 #include <boost/detail/workaround.hpp>
|
Chris@101
|
20 #include <boost/static_assert.hpp>
|
Chris@16
|
21
|
Chris@16
|
22 // BOOST_CB_ENABLE_DEBUG: Debug support control.
|
Chris@16
|
23 #if defined(NDEBUG) || defined(BOOST_CB_DISABLE_DEBUG)
|
Chris@16
|
24 #define BOOST_CB_ENABLE_DEBUG 0
|
Chris@16
|
25 #else
|
Chris@16
|
26 #define BOOST_CB_ENABLE_DEBUG 1
|
Chris@16
|
27 #endif
|
Chris@16
|
28
|
Chris@16
|
29 // BOOST_CB_ASSERT: Runtime assertion.
|
Chris@16
|
30 #if BOOST_CB_ENABLE_DEBUG
|
Chris@16
|
31 #include <boost/assert.hpp>
|
Chris@16
|
32 #define BOOST_CB_ASSERT(Expr) BOOST_ASSERT(Expr)
|
Chris@16
|
33 #else
|
Chris@16
|
34 #define BOOST_CB_ASSERT(Expr) ((void)0)
|
Chris@16
|
35 #endif
|
Chris@16
|
36
|
Chris@16
|
37 // BOOST_CB_IS_CONVERTIBLE: Check if Iterator::value_type is convertible to Type.
|
Chris@101
|
38 #if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407)
|
Chris@16
|
39 #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0)
|
Chris@16
|
40 #else
|
Chris@16
|
41 #include <boost/detail/iterator.hpp>
|
Chris@16
|
42 #include <boost/type_traits/is_convertible.hpp>
|
Chris@16
|
43 #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) \
|
Chris@101
|
44 BOOST_STATIC_ASSERT((is_convertible<typename detail::iterator_traits<Iterator>::value_type, Type>::value))
|
Chris@16
|
45 #endif
|
Chris@16
|
46
|
Chris@16
|
47 // BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS:
|
Chris@16
|
48 // Check if the STL provides templated iterator constructors for its containers.
|
Chris@16
|
49 #if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
|
Chris@101
|
50 #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_STATIC_ASSERT(false);
|
Chris@16
|
51 #else
|
Chris@16
|
52 #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0);
|
Chris@16
|
53 #endif
|
Chris@16
|
54
|
Chris@16
|
55 #include <boost/circular_buffer/debug.hpp>
|
Chris@16
|
56 #include <boost/circular_buffer/details.hpp>
|
Chris@16
|
57 #include <boost/circular_buffer/base.hpp>
|
Chris@16
|
58 #include <boost/circular_buffer/space_optimized.hpp>
|
Chris@16
|
59
|
Chris@16
|
60 #undef BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS
|
Chris@16
|
61 #undef BOOST_CB_IS_CONVERTIBLE
|
Chris@16
|
62 #undef BOOST_CB_ASSERT
|
Chris@16
|
63 #undef BOOST_CB_ENABLE_DEBUG
|
Chris@16
|
64
|
Chris@16
|
65 #endif // #if !defined(BOOST_CIRCULAR_BUFFER_HPP)
|