From 3e8abcbbbbb3809e809bec65a8a4d83cba8c4927 Mon Sep 17 00:00:00 2001 From: khizmax Date: Fri, 31 Oct 2014 00:37:55 +0300 Subject: [PATCH] Add statistics() method to split-list --- cds/container/split_list_map.h | 7 +++++++ cds/container/split_list_map_nogc.h | 7 +++++++ cds/container/split_list_map_rcu.h | 7 +++++++ cds/container/split_list_set.h | 7 +++++++ cds/container/split_list_set_nogc.h | 7 +++++++ cds/container/split_list_set_rcu.h | 7 +++++++ cds/intrusive/split_list.h | 6 ++++++ cds/intrusive/split_list_nogc.h | 6 ++++++ cds/intrusive/split_list_rcu.h | 6 ++++++ 9 files changed, 60 insertions(+) diff --git a/cds/container/split_list_map.h b/cds/container/split_list_map.h index 0128b92d..cf560e5d 100644 --- a/cds/container/split_list_map.h +++ b/cds/container/split_list_map.h @@ -135,6 +135,7 @@ namespace cds { namespace container { typedef typename base_class::hash hash; ///< Hash functor for \ref key_type typedef typename base_class::item_counter item_counter; ///< Item counter type + typedef typename base_class::stat stat; ///< Internal statistics protected: //@cond @@ -588,6 +589,12 @@ namespace cds { namespace container { { return base_class::size(); } + + /// Returns internal statistics + stat const& statistics() const + { + return base_class::statistics(); + } }; diff --git a/cds/container/split_list_map_nogc.h b/cds/container/split_list_map_nogc.h index ad7b785d..6104f191 100644 --- a/cds/container/split_list_map_nogc.h +++ b/cds/container/split_list_map_nogc.h @@ -56,6 +56,7 @@ namespace cds { namespace container { typedef typename base_class::hash hash; ///< Hash functor for \ref key_type typedef typename base_class::item_counter item_counter; ///< Item counter type + typedef typename base_class::stat stat; ///< Internal statistics protected: //@cond @@ -279,6 +280,12 @@ namespace cds { namespace container { { return base_class::size(); } + + /// Returns internal statistics + stat const& statistics() const + { + return base_class::statistics(); + } }; }} // namespace cds::container diff --git a/cds/container/split_list_map_rcu.h b/cds/container/split_list_map_rcu.h index c9d2d7e2..c18aa9dc 100644 --- a/cds/container/split_list_map_rcu.h +++ b/cds/container/split_list_map_rcu.h @@ -172,6 +172,7 @@ namespace cds { namespace container { typedef typename base_class::hash hash; ///< Hash functor for \ref key_type typedef typename base_class::item_counter item_counter; ///< Item counter type + typedef typename base_class::stat stat; ///< Internal statistics typedef typename base_class::rcu_lock rcu_lock; ///< RCU scoped lock typedef typename base_class::exempt_ptr exempt_ptr; ///< pointer to extracted node @@ -647,6 +648,12 @@ namespace cds { namespace container { { return base_class::size(); } + + /// Returns internal statistics + stat const& statistics() const + { + return base_class::statistics(); + } }; }} // namespace cds::container diff --git a/cds/container/split_list_set.h b/cds/container/split_list_set.h index e272e8e3..5d911109 100644 --- a/cds/container/split_list_set.h +++ b/cds/container/split_list_set.h @@ -150,6 +150,7 @@ namespace cds { namespace container { /// Hash functor for \p %value_type and all its derivatives that you use typedef typename base_class::hash hash; typedef typename base_class::item_counter item_counter; ///< Item counter type + typedef typename base_class::stat stat; ///< Internal statistics protected: //@cond @@ -723,6 +724,12 @@ namespace cds { namespace container { return base_class::size(); } + /// Returns internal statistics + stat const& statistics() const + { + return base_class::statistics(); + } + protected: //@cond using base_class::extract_; diff --git a/cds/container/split_list_set_nogc.h b/cds/container/split_list_set_nogc.h index 879eb59a..49e07c06 100644 --- a/cds/container/split_list_set_nogc.h +++ b/cds/container/split_list_set_nogc.h @@ -56,6 +56,7 @@ namespace cds { namespace container { /// Hash functor for \ref value_type and all its derivatives that you use typedef typename base_class::hash hash; typedef typename base_class::item_counter item_counter; ///< Item counter type + typedef typename base_class::stat stat; ///< Internal statistics protected: //@cond @@ -334,6 +335,12 @@ namespace cds { namespace container { { return base_class::size(); } + + /// Returns internal statistics + stat const& statistics() const + { + return base_class::statistics(); + } }; }} // namespace cds::container diff --git a/cds/container/split_list_set_rcu.h b/cds/container/split_list_set_rcu.h index 51d64583..14fe8c38 100644 --- a/cds/container/split_list_set_rcu.h +++ b/cds/container/split_list_set_rcu.h @@ -186,6 +186,7 @@ namespace cds { namespace container { /// Hash functor for \ref value_type and all its derivatives that you use typedef typename base_class::hash hash; typedef typename base_class::item_counter item_counter; ///< Item counter type + typedef typename base_class::stat stat; ///< Internal statistics typedef typename base_class::rcu_lock rcu_lock ; ///< RCU scoped lock /// Group of \p extract_xxx functions require external locking if underlying ordered list requires that @@ -780,6 +781,12 @@ namespace cds { namespace container { { return base_class::size(); } + + /// Returns internal statistics + stat const& statistics() const + { + return base_class::statistics(); + } }; }} // namespace cds::container diff --git a/cds/intrusive/split_list.h b/cds/intrusive/split_list.h index 87cabecc..687401de 100644 --- a/cds/intrusive/split_list.h +++ b/cds/intrusive/split_list.h @@ -1010,6 +1010,12 @@ namespace cds { namespace intrusive { } } + /// Returns internal statistics + stat const& statistics() const + { + return m_Stat; + } + protected: //@cond template diff --git a/cds/intrusive/split_list_nogc.h b/cds/intrusive/split_list_nogc.h index 28e7124d..7e7b4fa5 100644 --- a/cds/intrusive/split_list_nogc.h +++ b/cds/intrusive/split_list_nogc.h @@ -421,6 +421,12 @@ namespace cds { namespace intrusive { return m_ItemCounter; } + /// Returns internal statistics + stat const& statistics() const + { + return m_Stat; + } + protected: //@cond template diff --git a/cds/intrusive/split_list_rcu.h b/cds/intrusive/split_list_rcu.h index ecb04bc3..d21ba0f4 100644 --- a/cds/intrusive/split_list_rcu.h +++ b/cds/intrusive/split_list_rcu.h @@ -906,6 +906,12 @@ namespace cds { namespace intrusive { } } + /// Returns internal statistics + stat const& statistics() const + { + return m_Stat; + } + protected: //@cond template -- 2.34.1