OpenCPN Partial API docs
Loading...
Searching...
No Matches
comm_drv_registry.h File Reference

Driver registration container, a singleton. More...

#include "model/comm_driver.h"
#include "observable_evtvar.h"

Go to the source code of this file.

Classes

class  CommDriverRegistry
 The global driver registry, a singleton. More...
 

Typedefs

using DriverPtr = std::unique_ptr< AbstractCommDriver >
 

Functions

DriverPtr & FindDriver (const std::vector< DriverPtr > &drivers, const std::string &iface, const NavAddr::Bus _bus=NavAddr::Bus::Undef)
 Search list of drivers for a driver with given interface string.
 

Detailed Description

Driver registration container, a singleton.

Definition in file comm_drv_registry.h.

Typedef Documentation

◆ DriverPtr

using DriverPtr = std::unique_ptr<AbstractCommDriver>

Definition at line 32 of file comm_drv_registry.h.

Function Documentation

◆ FindDriver()

DriverPtr & FindDriver ( const std::vector< DriverPtr > &  drivers,
const std::string &  iface,
const NavAddr::Bus  _bus = NavAddr::Bus::Undef 
)

Search list of drivers for a driver with given interface string.

Returns
First found driver or shared_ptr<>(nullptr), which is false.
Note
The driver list is const in the sense that elements cannot be added, removed, etc. However, the driver returned needs to be non-const since most driver operations (notably sending) are non-const.

Definition at line 66 of file comm_drv_registry.cpp.