Template Class dllink¶
Defined in File dllist.hpp
Page Contents
Template Parameter Order¶
typename T
Class Documentation¶
-
template<typename T>
class dllink¶ doubly linked node (that may also be a “head” a list)
A Doubly-linked List class. This class simply contains a link of node’s. By adding a “head” node (sentinel), deleting a node is extremely fast (see “Introduction to Algorithm”). This class does not keep the length information as it is not necessary for the FM algorithm. This saves memory and run-time to update the length information. Note that this class does not own the list node. They are supplied by the caller in order to better reuse the nodes.
Public Functions
-
inline explicit constexpr dllink(T data) noexcept¶
Construct a new dllink object.
- Parameters
data – [in] the data
-
constexpr dllink() = default¶
Copy construct a new dllink object (deleted intentionally)
-
~dllink() = default¶
-
inline constexpr auto lock() noexcept -> void¶
lock the node (and don’t append it to any list)
-
inline constexpr auto is_locked() const noexcept -> bool¶
whether the node is locked
- Returns
true
- Returns
false
-
inline constexpr auto is_empty() const noexcept -> bool¶
whether the list is empty
- Returns
true
- Returns
false
-
inline constexpr auto clear() noexcept -> void¶
reset the list
-
inline constexpr auto detach() noexcept -> void¶
detach from a list
-
inline constexpr auto appendleft(dllink &node) noexcept -> void¶
append the node to the front
- Parameters
node – [inout]
-
inline constexpr auto append(dllink &node) noexcept -> void¶
append the node to the back
- Parameters
node – [inout]
-
inline constexpr auto popleft() noexcept -> dllink&¶
pop a node from the front
Precondition: list is not empty
- Returns
dllink&
-
inline constexpr auto pop() noexcept -> dllink&¶
pop a node from the back
Precondition: list is not empty
- Returns
dllink&
-
inline constexpr auto begin() noexcept -> dll_iterator<T>¶
begin
- Returns
-
inline constexpr auto end() noexcept -> dll_iterator<T>¶
end
- Returns
-
inline explicit constexpr dllink(T data) noexcept¶