DeviceUtilities.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_DEVICES_DEVICEUTILITIES_H
17 #define SURGSIM_DEVICES_DEVICEUTILITIES_H
18 
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 
24 namespace SurgSim
25 {
26 namespace Input
27 {
28 class DeviceInterface;
29 }
30 
31 namespace Devices
32 {
33 
38 std::shared_ptr<Input::DeviceInterface> createDevice(const std::vector<std::string>& classNames,
39  const std::string& name);
40 
45 std::shared_ptr<Input::DeviceInterface> createDevice(const std::string& className, const std::string& name);
46 
58 std::shared_ptr<Input::DeviceInterface> loadDevice(const std::string& fileName);
59 
60 };
61 };
62 
63 #endif // SURGSIM_DEVICES_DEVICEUTILITIES_H
64 
65 
SurgSim::Devices::createDevice
std::shared_ptr< DeviceInterface > createDevice(const std::vector< std::string > &classNames, const std::string &name)
Attempts to create and initialize a device from a list of devices to try.
Definition: DeviceUtilities.cpp:111
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::loadDevice
std::shared_ptr< DeviceInterface > loadDevice(const std::string &fileName)
Loads a single device from the file, the first device that successfully initializes.
Definition: DeviceUtilities.cpp:149
string
string(TOUPPER ${DEVICE} DEVICE_UPPER_CASE) option(BUILD_DEVICE_$
Definition: CMakeLists.txt:38