boo/src/inputdev/CDeviceBase.cpp

36 lines
594 B
C++
Raw Normal View History

2015-04-19 22:52:45 +00:00
#include "inputdev/CDeviceBase.hpp"
#include "inputdev/CDeviceToken.hpp"
#include "IHIDDevice.hpp"
CDeviceBase::CDeviceBase(CDeviceToken* token, IHIDDevice* hidDev)
: m_token(token), m_hidDev(hidDev)
{
hidDev->_setDeviceImp(this);
}
CDeviceBase::~CDeviceBase()
{
delete m_hidDev;
}
void CDeviceBase::_deviceDisconnected()
{
2015-04-22 21:48:23 +00:00
deviceDisconnected();
m_token = NULL;
if (m_hidDev)
{
m_hidDev->_deviceDisconnected();
delete m_hidDev;
m_hidDev = NULL;
}
}
2015-04-19 22:52:45 +00:00
2015-04-22 21:48:23 +00:00
void CDeviceBase::closeDevice()
{
if (m_token)
m_token->_deviceClose();
}