FastLED 3.10.8
Loading...
Searching...
No Matches

◆ removeFromList()

void CLEDController::removeFromList ( CLEDController * controller)
static

Remove a controller from the linked list.

Parameters
controllerThe controller to remove from the list
Note
Protected static method - subclasses can call this in their cleanup methods

Definition at line 97 of file cled_controller.cpp.hpp.

97 {
98 if (controller == nullptr) {
99 return;
100 }
101
102 // Remove the specified controller from the linked list
103 CLEDController* prev = nullptr;
104 CLEDController* curr = mPHead;
105
106 // Find the controller in the linked list
107 while (curr != nullptr) {
108 if (curr == controller) {
109 // Found it - remove from list
110 if (prev == nullptr) {
111 // Removing head
113 } else {
114 // Removing from middle or end
115 prev->mPNext = controller->mPNext;
116 }
117
118 // Clear the controller's next pointer
119 controller->mPNext = nullptr;
120 break;
121 }
122 prev = curr;
123 curr = curr->mPNext;
124 }
125}
CLEDController * controller
CLEDController * mPNext
pointer to the next LED controller in the linked list
static CLEDController * mPHead
pointer to the first LED controller in the linked list
CLEDController(RegistrationMode mode) FL_NO_EXCEPT
Protected constructor with registration mode.

References CLEDController(), controller, fl::FL_NO_EXCEPT, mPHead, and mPNext.

Referenced by removeFromDrawList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: