|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58265 - in sandbox/memory/boost: . memory/container
From: xushiweizh_at_[hidden]
Date: 2009-12-10 07:53:13
Author: xushiwei
Date: 2009-12-10 07:53:12 EST (Thu, 10 Dec 2009)
New Revision: 58265
URL: http://svn.boost.org/trac/boost/changeset/58265
Log:
class dcl_list;
Text files modified:
sandbox/memory/boost/memory.hpp | 4 ++
sandbox/memory/boost/memory/container/dcl_list.hpp | 55 ++++++++++++++++++---------------------
2 files changed, 30 insertions(+), 29 deletions(-)
Modified: sandbox/memory/boost/memory.hpp
==============================================================================
--- sandbox/memory/boost/memory.hpp (original)
+++ sandbox/memory/boost/memory.hpp 2009-12-10 07:53:12 EST (Thu, 10 Dec 2009)
@@ -34,6 +34,10 @@
#include "memory/pools.hpp"
#endif
+#ifndef BOOST_MEMORY_CONTAINER_DCL_LIST_HPP
+#include "memory/container/dcl_list.hpp"
+#endif
+
// -------------------------------------------------------------------------
// default_alloc
Modified: sandbox/memory/boost/memory/container/dcl_list.hpp
==============================================================================
--- sandbox/memory/boost/memory/container/dcl_list.hpp (original)
+++ sandbox/memory/boost/memory/container/dcl_list.hpp 2009-12-10 07:53:12 EST (Thu, 10 Dec 2009)
@@ -76,21 +76,11 @@
}
public:
- __forceinline bool BOOST_MEMORY_CALL empty() const
- {
- return m_next == this;
- }
-
bool BOOST_MEMORY_CALL valid() const
{
return m_prev->m_next == this && m_next->m_prev == this;
}
- void BOOST_MEMORY_CALL clear()
- {
- m_next = m_prev = this;
- }
-
void BOOST_MEMORY_CALL erase()
{
BOOST_MEMORY_ASSERT(valid());
@@ -98,18 +88,6 @@
m_prev->m_next = m_next;
m_prev = m_next = this;
}
-
- __forceinline void BOOST_MEMORY_CALL pop_front()
- {
- BOOST_MEMORY_ASSERT(!empty());
- static_cast<dcl_list_node_base_*>(m_next)->erase();
- }
-
- __forceinline void BOOST_MEMORY_CALL pop_back()
- {
- BOOST_MEMORY_ASSERT(!empty());
- static_cast<dcl_list_node_base_*>(m_prev)->erase();
- }
};
template <class NodeT>
@@ -194,12 +172,34 @@
typedef const NodeT& const_reference;
public:
- void BOOST_MEMORY_CALL push_front(dcl_list_node<NodeT>* node)
+ __forceinline bool BOOST_MEMORY_CALL empty() const
+ {
+ return m_next == this;
+ }
+
+ __forceinline void BOOST_MEMORY_CALL clear()
+ {
+ m_next = m_prev = this;
+ }
+
+ void BOOST_MEMORY_CALL pop_front()
+ {
+ BOOST_MEMORY_ASSERT(!empty());
+ static_cast<dcl_list_node_base_*>(m_next)->erase();
+ }
+
+ void BOOST_MEMORY_CALL pop_back()
+ {
+ BOOST_MEMORY_ASSERT(!empty());
+ static_cast<dcl_list_node_base_*>(m_prev)->erase();
+ }
+
+ void BOOST_MEMORY_CALL push_front(NodeT* node)
{
node->insert_me_front_(*this);
}
- void BOOST_MEMORY_CALL push_back(dcl_list_node<NodeT>* node)
+ void BOOST_MEMORY_CALL push_back(NodeT* node)
{
node->insert_me_back_(*this);
}
@@ -236,12 +236,9 @@
return static_cast<const dcl_list_node_base_*>(node) == this;
}
-private:
- typedef dcl_list_node<NodeT> BaseNodeT;
-
public:
- typedef dcl_list_iterator_<BaseNodeT, BaseNodeT&, BaseNodeT*> iterator;
- typedef dcl_list_iterator_<BaseNodeT, const BaseNodeT&, const BaseNodeT*> const_iterator;
+ typedef dcl_list_iterator_<NodeT, NodeT&, NodeT*> iterator;
+ typedef dcl_list_iterator_<NodeT, const NodeT&, const NodeT*> const_iterator;
iterator BOOST_MEMORY_CALL begin() { return iterator(first()); }
const_iterator BOOST_MEMORY_CALL begin() const { return const_iterator(first()); }
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk