OutputComponent.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_INPUT_OUTPUTCOMPONENT_H
17 #define SURGSIM_INPUT_OUTPUTCOMPONENT_H
18 
19 #include <string>
20 #include <memory>
22 
23 namespace SurgSim
24 {
25 
26 namespace DataStructures
27 {
28 class DataGroup;
29 }
30 
31 namespace Input
32 {
33 class DeviceInterface;
34 class OutputProducer;
35 
36 SURGSIM_STATIC_REGISTRATION(OutputComponent);
37 
41 {
42 public:
45  explicit OutputComponent(const std::string& name);
47  virtual ~OutputComponent();
48 
50 
53  void setDeviceName(const std::string& deviceName);
54 
57  bool isDeviceConnected();
58 
62  void connectDevice(std::shared_ptr<SurgSim::Input::DeviceInterface> device);
63 
67  void disconnectDevice(std::shared_ptr<SurgSim::Input::DeviceInterface> device);
68 
71  void setData(const SurgSim::DataStructures::DataGroup& dataGroup);
72 
74  virtual bool doInitialize();
75 
77  virtual bool doWakeUp();
78 
81  std::string getDeviceName() const;
82 
83 private:
89  std::shared_ptr<OutputProducer> m_output;
90 };
91 
92 }; // namespace Input
93 }; // namespace SurgSim
94 
95 
96 #endif
Definition: DriveElementFromInputBehavior.cpp:27
std::shared_ptr< OutputProducer > m_output
Output producer which sends data to hardware device.
Definition: OutputComponent.h:89
SURGSIM_STATIC_REGISTRATION(SerializationMockComponent)
Component is the main interface class to pass information to the system managers each will decide whe...
Definition: Component.h:43
string(TOUPPER ${DEVICE}DEVICE_UPPER_CASE) option(BUILD_DEVICE_ $
Definition: CMakeLists.txt:35
OutputComponent is a Component that has an OutputProducer, a concrete instance of OutputProducerInter...
Definition: OutputComponent.h:40
#define SURGSIM_CLASSNAME(ClassName)
Declare the class name of a class with the appropriate function header, do not use quotes...
Definition: Macros.h:21
A collection of NamedData objects.
Definition: DataGroup.h:66
std::string m_deviceName
Name of the device to which this output component connects.
Definition: OutputComponent.h:85
bool m_deviceConnected
Indicates if this output component is connected to a device.
Definition: OutputComponent.h:87