summaryrefslogtreecommitdiff
path: root/sql/sql_plist.h
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2011-04-11 08:39:15 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2011-04-11 08:39:15 -0300
commit754381c4b9e35ba5a2b2e11cb6c8194aa13c7831 (patch)
tree867cdbe9a4bad2b7fa8efb52d7e9142e44e96198 /sql/sql_plist.h
parent9f1cacbbc39d40a087af0854d4b5ee5fe2b71ed9 (diff)
downloadmariadb-git-754381c4b9e35ba5a2b2e11cb6c8194aa13c7831.tar.gz
Move I_P_List_adapter to sql_plist.h as it is currently being used
for code other then in mdl.h. Since the adapter is generic, it is better located in sql_plist.h.
Diffstat (limited to 'sql/sql_plist.h')
-rw-r--r--sql/sql_plist.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_plist.h b/sql/sql_plist.h
index db85266be15..4395b9e4e8b 100644
--- a/sql/sql_plist.h
+++ b/sql/sql_plist.h
@@ -188,6 +188,20 @@ public:
/**
+ Hook class which via its methods specifies which members
+ of T should be used for participating in a intrusive list.
+*/
+
+template <typename T, T* T::*next, T** T::*prev>
+struct I_P_List_adapter
+{
+ static inline T **next_ptr(T *el) { return &(el->*next); }
+
+ static inline T ***prev_ptr(T *el) { return &(el->*prev); }
+};
+
+
+/**
Element counting policy class for I_P_List to be used in
cases when no element counting should be done.
*/