This class manages all device plugins and maintains a device if asked to do so.
More...
#include <DeviceManager.h>
This class manages all device plugins and maintains a device if asked to do so.
This enables applications to access their output device without having to carry it through the whole application.
◆ get3DDevice()
static std::shared_ptr<I3DDevice> DeviceManager::get3DDevice |
( |
| ) |
|
|
static |
Returns the currently handled 3D device.
- Returns
- The handled device or nullptr if no device has been registered or the registered device is not an I3DDevice.
◆ getAvailableDeviceNames()
static std::vector<std::string> DeviceManager::getAvailableDeviceNames |
( |
| ) |
|
|
static |
Returns a list of available devices.
- Returns
- A list of strings with the names of available devices.
◆ getDefaultDeviceFactory()
static std::shared_ptr<IDeviceFactory> DeviceManager::getDefaultDeviceFactory |
( |
| ) |
|
|
static |
Returns the default device based on the priorities of the registered factories.
- Returns
- The default device or nullptr if no factory has been registered.
◆ getDevice()
static std::shared_ptr<IDevice> DeviceManager::getDevice |
( |
| ) |
|
|
static |
Returns the currently handled device.
- Returns
- The handled device or nullptr if no device has been registered.
◆ getDeviceFactory()
static std::shared_ptr<IDeviceFactory> DeviceManager::getDeviceFactory |
( |
std::string |
name | ) |
|
|
static |
Returns the factory for a specific device.
- Parameters
-
name | The representative name of the device. |
- Returns
- The factory if it was found, or nullptr otherwise.
◆ openDefaultDevice()
static void DeviceManager::openDefaultDevice |
( |
| ) |
|
|
static |
Opens the default device which will then be handled by the manager.
The device to open is selected based on the priority of the registered factories. If a device is currently being handled it will be released.
◆ openDevice()
static void DeviceManager::openDevice |
( |
std::string |
name | ) |
|
|
static |
Opens a device which will then be handled by the manager.
If a device is currently being handled it will be released.
- Parameters
-
name | The representative name of the device. |
◆ registerDevice()
static void DeviceManager::registerDevice |
( |
std::string |
name, |
|
|
std::shared_ptr< IDeviceFactory > |
factory |
|
) |
| |
|
static |
Registers a device factory.
This method is mostly used by plugin developers to add their device implementation for general use by the library end users.
- Parameters
-
name | A representative name for the device. |
factory | The factory that creates the device. |
◆ setDevice()
static void DeviceManager::setDevice |
( |
std::shared_ptr< IDevice > |
device | ) |
|
|
static |
Sets a device that should be handled by the manager.
If a device is currently being handled it will be released.
- Parameters
-
device | The device the manager should take care of. |
The documentation for this class was generated from the following file: