Chris@16: // Circular buffer library header file. Chris@16: Chris@16: // Copyright (c) 2003-2008 Jan Gaspar Chris@16: Chris@16: // Use, modification, and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See www.boost.org/libs/circular_buffer for documentation. Chris@16: Chris@16: #if !defined(BOOST_CIRCULAR_BUFFER_HPP) Chris@16: #define BOOST_CIRCULAR_BUFFER_HPP Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@101: #include Chris@16: Chris@16: // BOOST_CB_ENABLE_DEBUG: Debug support control. Chris@16: #if defined(NDEBUG) || defined(BOOST_CB_DISABLE_DEBUG) Chris@16: #define BOOST_CB_ENABLE_DEBUG 0 Chris@16: #else Chris@16: #define BOOST_CB_ENABLE_DEBUG 1 Chris@16: #endif Chris@16: Chris@16: // BOOST_CB_ASSERT: Runtime assertion. Chris@16: #if BOOST_CB_ENABLE_DEBUG Chris@16: #include Chris@16: #define BOOST_CB_ASSERT(Expr) BOOST_ASSERT(Expr) Chris@16: #else Chris@16: #define BOOST_CB_ASSERT(Expr) ((void)0) Chris@16: #endif Chris@16: Chris@16: // BOOST_CB_IS_CONVERTIBLE: Check if Iterator::value_type is convertible to Type. Chris@101: #if BOOST_WORKAROUND(__BORLANDC__, <= 0x0550) || BOOST_WORKAROUND(__MWERKS__, <= 0x2407) Chris@16: #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) ((void)0) Chris@16: #else Chris@16: #include Chris@16: #include Chris@16: #define BOOST_CB_IS_CONVERTIBLE(Iterator, Type) \ Chris@101: BOOST_STATIC_ASSERT((is_convertible::value_type, Type>::value)) Chris@16: #endif Chris@16: Chris@16: // BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS: Chris@16: // Check if the STL provides templated iterator constructors for its containers. Chris@16: #if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) Chris@101: #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS BOOST_STATIC_ASSERT(false); Chris@16: #else Chris@16: #define BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS ((void)0); Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #undef BOOST_CB_ASSERT_TEMPLATED_ITERATOR_CONSTRUCTORS Chris@16: #undef BOOST_CB_IS_CONVERTIBLE Chris@16: #undef BOOST_CB_ASSERT Chris@16: #undef BOOST_CB_ENABLE_DEBUG Chris@16: Chris@16: #endif // #if !defined(BOOST_CIRCULAR_BUFFER_HPP)