iMSTK
Interactive Medical Simulation Toolkit
|
Manages and generates the DeviceManager's. More...
#include <imstkDeviceManagerFactory.h>
Static Public Member Functions | |
static std::shared_ptr< DeviceManager > | makeDeviceManager (const std::string typeName) |
Attempts to create a new DeviceManager by type name. More... | |
static std::shared_ptr< DeviceManager > | makeDeviceManager () |
Attempts to create a new DeviceManager by whichever is default If multiple haptic managers are built with, the preference is: Haply > OpenHaptics > VRPN. More... | |
![]() | |
static std::shared_ptr< DeviceManager > | create (const std::string &name, Args &&... args) |
tries to construct the object give name, it will forward the given paramters More... | |
static void | add (const std::string &name, Creator c) |
adds a new creation function to the factory More... | |
static bool | contains (const std::string &name) |
static const std::vector< std::string > | getNames () |
Additional Inherited Members | |
![]() | |
using | BaseType = std::shared_ptr< DeviceManager > |
using | Creator = std::function< std::shared_ptr< DeviceManager >(Args...)> |
Type of the function to generate a new object. | |
Manages and generates the DeviceManager's.
The factory is a singleton and can be accessed anywhere. Given a name of a DeviceManager this will generate the appropriate object that should be executed. By default the class name is the name that is used to look up the DeviceManager. ie: "HapticDeviceManager" -> HapticDeviceManager The generation Will fail if the name is not known to the factory.
There are multiple ways to register a DeviceManager, preferred should be ...
will register the delegate for the class-name of the algorithm, this will satisfy the default mechanism If want to register a custom delegate with more customization you can use
Definition at line 37 of file imstkDeviceManagerFactory.h.
|
static |
Attempts to create a new DeviceManager by type name.
typeName | name of the class to look up |
Definition at line 37 of file imstkDeviceManagerFactory.cpp.
|
static |
Attempts to create a new DeviceManager by whichever is default If multiple haptic managers are built with, the preference is: Haply > OpenHaptics > VRPN.
Definition at line 51 of file imstkDeviceManagerFactory.cpp.