Select best driver for channel data (used by Channel::showPixels)
- Parameters
-
| data | Channel data to route (chipset configuration) |
| affinity | Engine affinity name (empty = no affinity, dynamic selection) |
- Returns
- Shared pointer to selected driver, or nullptr if none compatible
- Note
- Iterates drivers by priority (already sorted descending) and returns first that canHandle()
-
This is called lazily in Channel::showPixels() if no driver is bound
Definition at line 425 of file manager.cpp.hpp.
425 {
426 if (!data) {
427 FL_ERROR(
"ChannelManager::selectDriverForChannel() - Null channel data");
428 return fl::shared_ptr<IChannelDriver>();
429 }
430
431
432
433
434
435
436
437 do {
438 if (affinity.
empty()) {
439 break;
440 }
442 if (!driver) {
443 break;
444 }
445 if (!driver->canHandle(data)) {
446 FL_WARN_ONCE(
"ChannelManager: Affinity driver '" << affinity <<
"' cannot handle channel data (chipset/bus mismatch). Falling back to AUTO/priority dispatch.");
447 break;
448 }
449 return driver;
450 } while (false);
451
452
453
454 for (
const auto& entry :
mDrivers) {
455 if (!entry.enabled) continue;
456 if (entry.driver->canHandle(data)) {
457 return entry.driver;
458 }
459 }
460
461 FL_ERROR(
"ChannelManager: No compatible driver found for channel data");
462 return fl::shared_ptr<IChannelDriver>();
463}
fl::shared_ptr< IChannelDriver > findDriverByName(const fl::string &name) const FL_NO_EXCEPT
Silent counterpart to getDriverByName().
fl::vector< EngineEntry > mDrivers
Shared drivers sorted by priority descending (higher values first)
bool empty() const FL_NO_EXCEPT
#define FL_WARN_ONCE(...)
References findDriverByName(), FL_ERROR, fl::FL_NO_EXCEPT, FL_WARN_ONCE, and mDrivers.
Referenced by fl::Channel::resolveDynamicDriver().