KeyboardDevice.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_KEYBOARD_KEYBOARDDEVICE_H
17 #define SURGSIM_DEVICES_KEYBOARD_KEYBOARDDEVICE_H
18 
19 #include <memory>
20 #include <string>
21 
23 
24 namespace SurgSim
25 {
26 namespace Device
27 {
28 class KeyboardScaffold;
29 class OsgKeyboardHandler;
30 
45 {
46  friend class KeyboardScaffold;
47  friend class KeyboardDeviceTest;
48 
49 public:
52  explicit KeyboardDevice(const std::string& deviceName);
54  virtual ~KeyboardDevice();
55 
58  virtual bool initialize() override;
61  virtual bool finalize() override;
62 
65  bool isInitialized() const;
66 
70 
71 private:
73  std::shared_ptr<KeyboardScaffold> m_scaffold;
74 };
75 
76 }; // namespace Device
77 }; // namespace SurgSim
78 
79 #endif //SURGSIM_DEVICES_KEYBOARD_KEYBOARDDEVICE_H
Definition: DriveElementFromInputBehavior.cpp:27
OsgKeyboardHandler * getKeyboardHandler() const
Get keyboard handler.
Definition: KeyboardDevice.cpp:66
A class that implements the behavior of KeyboardDevice objects.
Definition: KeyboardScaffold.h:38
virtual ~KeyboardDevice()
Destructor.
Definition: KeyboardDevice.cpp:32
KeyboardDevice(const std::string &deviceName)
Constructor.
Definition: KeyboardDevice.cpp:27
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
bool isInitialized() const
Check if the scaffold of this device is initialized.
Definition: KeyboardDevice.cpp:61
A class implementing the communication with a keyboard.
Definition: KeyboardDevice.h:44
virtual bool initialize() override
Initialize this device and register it with corresponding scaffold.
Definition: KeyboardDevice.cpp:40
friend class KeyboardDeviceTest
Definition: KeyboardDevice.h:47
A class that implements some common management code on top of the DeviceInterface.
Definition: CommonDevice.h:34
Definition: OsgKeyboardHandler.h:30
virtual bool finalize() override
"De"-initialize this device and unregister from the scaffold.
Definition: KeyboardDevice.cpp:53
std::shared_ptr< KeyboardScaffold > m_scaffold
Communication with hardware is handled by scaffold.
Definition: KeyboardDevice.h:73