KeyboardScaffold.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_KEYBOARD_KEYBOARDSCAFFOLD_H
#define SURGSIM_DEVICES_KEYBOARD_KEYBOARDSCAFFOLD_H
#include <memory>
#include "SurgSim/Framework/Logger.h"
namespace SurgSim
{
namespace DataStructures
{
class DataGroup;
}
namespace Devices
{
class KeyboardDevice;
class OsgKeyboardHandler;
class KeyboardScaffold
{
friend class KeyboardDevice;
friend class KeyboardDeviceTest;
friend class OsgKeyboardHandler;
public:
KeyboardScaffold();
~KeyboardScaffold();
static std::shared_ptr<KeyboardScaffold> getOrCreateSharedInstance();
private:
struct DeviceData;
bool registerDevice(KeyboardDevice* device);
bool unregisterDevice();
bool updateDevice(int key, int modifierMask);
OsgKeyboardHandler* getKeyboardHandler() const;
static SurgSim::DataStructures::DataGroup buildDeviceInputData();
std::shared_ptr<SurgSim::Framework::Logger> m_logger;
std::unique_ptr<DeviceData> m_device;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_KEYBOARD_KEYBOARDSCAFFOLD_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::KeyboardScaffold::m_logger
std::shared_ptr< SurgSim::Framework::Logger > m_logger
Logger used by the scaffold and all devices.
Definition: KeyboardScaffold.h:84
SurgSim::Devices::KeyboardDevice
A class implementing the communication with a keyboard.
Definition: KeyboardDevice.h:46
SurgSim::Devices::KeyboardScaffold
A class that implements the behavior of KeyboardDevice objects.
Definition: KeyboardScaffold.h:38
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::Devices::OsgKeyboardHandler
Definition: OsgKeyboardHandler.h:30
SurgSim::Devices::KeyboardScaffold::m_device
std::unique_ptr< DeviceData > m_device
The keyboard device managed by this scaffold.
Definition: KeyboardScaffold.h:86
Logger.h
SurgSim::Devices::KeyboardScaffold::DeviceData
Struct to hold a KeyboardDevice object, a KeyboardHandler object, and a mutex for data passing...
Definition: KeyboardScaffold.cpp:31