MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_device()

std::shared_ptr< SerialDevice > MayaFlux::Core::SerialInputBackend::get_device ( uint32_t device_id) const
nodiscard

The open device, or null.

A reading resolves to the device it reads. For requests and replies.

Definition at line 452 of file SerialInputBackend.cpp.

453{
454 if (const auto roster = m_roster.read()) {
455 const auto it = roster->entries.find(device_id);
456 if (it != roster->entries.end()) {
457 if (it->second.parent != 0) {
458 const auto parent = roster->entries.find(it->second.parent);
459 return parent != roster->entries.end() ? parent->second.device : nullptr;
460 }
461 return it->second.device;
462 }
463 }
464 return nullptr;
465}
Memory::SnapshotCell< Roster > m_roster

References get_device(), and m_roster.

Referenced by add_reader(), get_device(), is_device_open(), open_device(), and write().

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