|
ESPHome 2026.12.0-dev
|
One pointer per node that holds the next node of a chain, or on the last node the chain's owner. More...
#include <chain.h>
Public Member Functions | |
| bool | is_owner () const |
| Next * | next () const |
| The next node, or nullptr on the last one. | |
| Owner * | owner () const |
| Only valid when is_owner(). | |
| Next ** | next_slot () |
| Where the next node goes, for appending without a branch; only valid when !is_owner(). | |
| void | set_next (Next *next) |
| void | set_owner (Owner *owner) |
| Makes this the last node. | |
| void | set (Next *next, Owner *owner) |
| Link to next, or to owner when next is nullptr. | |
Static Public Member Functions | |
| static Next * | tagged (Owner *owner) |
| The value set_owner() stores, for writing through next_slot(). The owner is never null. | |
Protected Attributes | |
| Next * | ptr_ {nullptr} |
Static Protected Attributes | |
| static constexpr uintptr_t | OWNER_TAG = 1 |
One pointer per node that holds the next node of a chain, or on the last node the chain's owner.
The owner is tagged in the low bit, so it needs an alignment of at least 2. A chain may also end in nullptr, with no owner.
|
inline |
|
inline |
|
inline |
|
inline |
Only valid when is_owner().
|
inline |
|
inline |
|
inline |
|
inlinestatic |
The value set_owner() stores, for writing through next_slot(). The owner is never null.
|
staticconstexprprotected |
|
protected |