boo/include/inputdev/IHIDListener.hpp

41 lines
852 B
C++
Raw Normal View History

2015-04-19 22:52:45 +00:00
#ifndef IHIDLISTENER_HPP
#define IHIDLISTENER_HPP
2015-04-24 00:24:15 +00:00
#include <unordered_map>
#include <mutex>
2015-08-18 18:00:24 +00:00
#include "DeviceToken.hpp"
2015-04-29 10:24:39 +00:00
namespace boo
{
2015-08-18 19:40:26 +00:00
typedef std::unordered_map<std::string, DeviceToken> TDeviceTokens;
2015-04-22 21:48:23 +00:00
typedef std::pair<TDeviceTokens::iterator, bool> TInsertedDeviceToken;
2015-08-18 19:40:26 +00:00
class DeviceFinder;
2015-04-19 22:52:45 +00:00
class IHIDListener
{
public:
virtual ~IHIDListener() {}
/* Automatic device scanning */
virtual bool startScanning()=0;
virtual bool stopScanning()=0;
/* Manual device scanning */
virtual bool scanNow()=0;
2015-05-04 04:28:07 +00:00
#if _WIN32
/* External listener implementation (for Windows) */
virtual bool _extDevConnect(const char* path)=0;
virtual bool _extDevDisconnect(const char* path)=0;
#endif
2015-04-19 22:52:45 +00:00
};
/* Platform-specific constructor */
2015-08-18 19:40:26 +00:00
IHIDListener* IHIDListenerNew(DeviceFinder& finder);
2015-04-29 10:24:39 +00:00
}
2015-04-19 22:52:45 +00:00
#endif // IHIDLISTENER_HPP