OpenCOVER
inputsource.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8/*
9 * inputsource.h
10 *
11 * Created on: Dec 5, 2014
12 * Author: svnvlad
13 */
14
15#ifndef INPUTSOURCE_H
16#define INPUTSOURCE_H
17
18#include <util/coExport.h>
19#include <string>
20#include <vector>
21
22namespace opencover
23{
24
25class InputDevice;
26
27class COVEREXPORT InputSource
28{
29public:
30 InputSource(const std::string &name, const std::string &kind);
31 virtual ~InputSource();
32 bool isValid() const;
34 virtual void update() = 0;
35 const std::string &name() const;
36 const std::string &config() const;
38 InputDevice *device(int i) const;
39 size_t numDevices() const {return m_dev.size();};
40
41protected:
42 void setValid(bool);
43 bool m_valid = false, m_oldValid = false;
44 int m_validDevice=0;
45
46private:
47 const std::string m_name;
48 const std::string m_conf;
49 std::vector<InputDevice *>m_dev;
50};
51
52}
53#endif
Definition: ARToolKit.h:33
The InputDevice class interacts with input hardware.
Definition: inputdevice.h:38
Definition: inputsource.h:28
const std::string & name() const
InputDevice * device() const
InputSource(const std::string &name, const std::string &kind)
size_t numDevices() const
Definition: inputsource.h:39
virtual void update()=0
const std::string & config() const
InputDevice * device(int i) const