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@16
|
14 #if defined(_MSC_VER) && _MSC_VER >= 1200
|
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@16
|
20
|
Chris@16
|
21 // BOOST_CB_ENABLE_DEBUG: Debug support control.
|
Chris@16
|
22 #if defined(NDEBUG) || defined(BOOST_CB_DISABLE_DEBUG)
|
Chris@16
|
23 #define BOOST_CB_ENABLE_DEBUG 0
|
Chris@16
|
24 #else
|
Chris@16
|
25 #define BOOST_CB_ENABLE_DEBUG 1
|
Chris@16
|
26 #endif
|
Chris@16
|
27
|
Chris@16
|
28 // BOOST_CB_ASSERT: Runtime assertion.
|
Chris@16
|
29 #if BOOST_CB_ENABLE_DEBUG
|
Chris@16
|
30 #include <boost/assert.hpp>
|
Chris@16
|
31 #define BOOST_CB_ASSERT(Expr) BOOST_ASSERT(Expr)
|
Chris@16
|
32 #else
|
Chris@16
|
33 #define BOOST_CB_ASSERT(Expr) ((void)0)
|
Chris@16
|
34 #endif
|
Chris@16
|
35
|
Chris@16
|
36 // BOOST_CB_STATIC_ASSERT: Compile time assertion.
|
Chris@16
|
37 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
Chris@16
|
38 #define BOOST_CB_STATIC_ASSERT(Expr) ((void)0)
|
Chris@16
|
39 #else
|
Chris@16
|
40 #include <boost/static_assert.hpp>
|
Chris@16
|
41 #define BOOST_CB_STATIC_ASSERT(Expr) BOOST_STATIC_ASSERT(Expr)
|
Chris@16
|
42 #endif
|
Chris@16
|
43
|
Chris@16
|
44 // BOOST_CB_IS_CONVERTIBLE: Check if Iterator::value_type is convertible to Type.
|
Chris@16
|
45 #if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407) || \
|
Chris@16
|
46 BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
Chris@16
|
47 #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0)
|
Chris@16
|
48 #else
|
Chris@16
|
49 #include <boost/detail/iterator.hpp>
|
Chris@16
|
50 #include <boost/type_traits/is_convertible.hpp>
|
Chris@16
|
51 #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) \
|
Chris@16
|
52 BOOST_CB_STATIC_ASSERT((is_convertible<typename detail::iterator_traits<Iterator>::value_type, Type>::value))
|
Chris@16
|
53 #endif
|
Chris@16
|
54
|
Chris@16
|
55 // BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS:
|
Chris@16
|
56 // Check if the STL provides templated iterator constructors for its containers.
|
Chris@16
|
57 #if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
|
Chris@16
|
58 #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_CB_STATIC_ASSERT(false);
|
Chris@16
|
59 #else
|
Chris@16
|
60 #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0);
|
Chris@16
|
61 #endif
|
Chris@16
|
62
|
Chris@16
|
63 #include <boost/circular_buffer/debug.hpp>
|
Chris@16
|
64 #include <boost/circular_buffer/details.hpp>
|
Chris@16
|
65 #include <boost/circular_buffer/base.hpp>
|
Chris@16
|
66 #include <boost/circular_buffer/space_optimized.hpp>
|
Chris@16
|
67
|
Chris@16
|
68 #undef BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS
|
Chris@16
|
69 #undef BOOST_CB_IS_CONVERTIBLE
|
Chris@16
|
70 #undef BOOST_CB_STATIC_ASSERT
|
Chris@16
|
71 #undef BOOST_CB_ASSERT
|
Chris@16
|
72 #undef BOOST_CB_ENABLE_DEBUG
|
Chris@16
|
73
|
Chris@16
|
74 #endif // #if !defined(BOOST_CIRCULAR_BUFFER_HPP)
|