template <typename Type> struct ut_list_node { Type *prev; /*!< pointer to the previous node, NULL if start of list */ Type *next; /*!< pointer to next node, NULL if end of list */
void reverse() { Type *tmp = prev; prev = next; next = tmp; } };
ulint count{0}; /*!< count of nodes in list */ elem_type *start{nullptr}; /*!< pointer to list start, NULL if empty */ elem_type *end{nullptr}; /*!< pointer to list end, NULL if empty */ node_ptr node{nullptr}; /*!< Pointer to member field that is used as a link node */ #ifdef UNIV_DEBUG ulint init{0}; /*!< UT_LIST_INITIALISED if the list was initialised with UT_LIST_INIT() */ #endif /* UNIV_DEBUG */
void reverse() { Type *tmp = start; start = end; end = tmp; } };
/** Functor for accessing the embedded node within a list element. This is required because some lists can have the node emebedded inside a nested struct/union. See lock0priv.h (table locks) for an example. It provides a specialised functor to grant access to the list node. */ template <typename Type> struct GenericGetNode { typedef ut_list_node<Type> node_type;