FastLED 3.9.15
Loading...
Searching...
No Matches
manager.h File Reference

Detailed Description

Unified manager for channel drivers with priority-based fallback.

The ChannelManager coordinates multiple channel drivers (e.g., PARLIO, SPI, RMT) and automatically selects the best available driver based on priority. It acts as a transparent proxy using the Proxy/Decorator pattern - strip drivers interact with it through the ChannelDriver interface without knowing about the manager's existence.

Design Pattern: Proxy/Decorator

  • Manager IS A ChannelDriver (inheritance for polymorphic use)
  • Forwards calls to active driver
  • Handles fallback automatically
  • Strip drivers unaware of manager's existence

Usage Pattern:

  1. Platform-specific code builds and configures manager with drivers
  2. Strip drivers obtain manager reference: mDriver = &ChannelManager::instance()
  3. Manager transparently selects best available driver
  4. Automatic fallback when driver allocation fails
  5. Per-frame reset allows driver re-evaluation

Definition in file manager.h.

#include "fl/channels/driver.h"
#include "fl/channels/data.h"
#include "fl/channels/bus.h"
#include "fl/channels/bus_traits.h"
#include "fl/system/engine_events.h"
#include "fl/stl/vector.h"
#include "fl/stl/shared_ptr.h"
#include "fl/stl/noexcept.h"
#include "platforms/channel_poll_signal.h"
+ Include dependency graph for manager.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  fl::ChannelManager
 Unified channel manager with priority-based driver selection. More...
 
struct  fl::ChannelManager::EngineEntry
 Engine registry entry (priority + shared pointer + runtime control) More...
 
struct  fl::DriverInfo
 Driver state information for channel manager. More...
 

Namespaces

namespace  fl
 Base definition for an LED controller.
 

Functions

ChannelManagerfl::channelManager () FL_NOEXCEPT
 Get the global ChannelManager singleton instance.
 

Class Documentation

◆ fl::DriverInfo

struct fl::DriverInfo
+ Collaboration diagram for fl::DriverInfo:
Class Members
bool enabled Whether driver is currently enabled.
string name Driver name (empty for unnamed drivers)
int priority Driver priority (higher = preferred)