diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-11-30 17:31:46 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-02 00:33:18 +0100 |
commit | efddd4b6e0e80bdbdb74ea43654d258dedb7d13d (patch) | |
tree | 0c9112cbf65a244da603962fe2e91bf7ccb92407 | |
parent | 2353618ff955cf5504ab7a69eaf2b7e5593b666b (diff) |
private pointer
Change-Id: I2c5b2a5d99236f3d3887bba994acd1cf77ae83ba
-rw-r--r-- | sw/inc/ring.hxx | 7 | ||||
-rw-r--r-- | sw/source/core/bastyp/ring.cxx | 23 |
2 files changed, 15 insertions, 15 deletions
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx index 9695a8f6599d..8b65d721e848 100644 --- a/sw/inc/ring.hxx +++ b/sw/inc/ring.hxx @@ -22,15 +22,18 @@ #include <swdllapi.h> #include <swtypes.hxx> +class Ring_node_traits; + class SW_DLLPUBLIC Ring { + friend class Ring_node_traits; + Ring* pNext; + Ring* pPrev; ///< In order to speed up inserting and deleting. protected: Ring(); Ring( Ring * ); public: - Ring* pNext; - Ring* pPrev; ///< In order to speed up inserting and deleting. virtual ~Ring(); void MoveTo( Ring *pDestRing ); void MoveRingTo( Ring *pDestRing ); diff --git a/sw/source/core/bastyp/ring.cxx b/sw/source/core/bastyp/ring.cxx index 25bac99d0ce8..5db41f54ad50 100644 --- a/sw/source/core/bastyp/ring.cxx +++ b/sw/source/core/bastyp/ring.cxx @@ -20,20 +20,17 @@ #include "ring.hxx" #include <boost/intrusive/circular_list_algorithms.hpp> -namespace +struct Ring_node_traits { - struct Ring_node_traits - { - typedef Ring node; - typedef Ring* node_ptr; - typedef const Ring* const_node_ptr; - static node_ptr get_next(const_node_ptr n) { return n->GetNext(); }; - static void set_next(node_ptr n, node_ptr next) { n->pNext = next; }; - static node_ptr get_previous(const_node_ptr n) { return n->GetPrev(); }; - static void set_previous(node_ptr n, node_ptr previous) { n->pPrev = previous; }; - }; - typedef boost::intrusive::circular_list_algorithms<Ring_node_traits> algo; -} + typedef Ring node; + typedef Ring* node_ptr; + typedef const Ring* const_node_ptr; + static node_ptr get_next(const_node_ptr n) { return n->GetNext(); }; + static void set_next(node_ptr n, node_ptr next) { n->pNext = next; }; + static node_ptr get_previous(const_node_ptr n) { return n->GetPrev(); }; + static void set_previous(node_ptr n, node_ptr previous) { n->pPrev = previous; }; +}; +typedef boost::intrusive::circular_list_algorithms<Ring_node_traits> algo; Ring::Ring() |