mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
24 lines
661 B
C++
24 lines
661 B
C++
#include "GpInputDriverFactory.h"
|
|
#include "GpInputDriverProperties.h"
|
|
|
|
#include <assert.h>
|
|
|
|
IGpInputDriver *GpInputDriverFactory::CreateInputDriver(const GpInputDriverProperties &properties)
|
|
{
|
|
assert(properties.m_type < EGpInputDriverType_Count);
|
|
|
|
if (ms_registry[properties.m_type])
|
|
return ms_registry[properties.m_type](properties);
|
|
else
|
|
return nullptr;
|
|
}
|
|
|
|
void GpInputDriverFactory::RegisterInputDriverFactory(EGpInputDriverType type, FactoryFunc_t func)
|
|
{
|
|
assert(type < EGpInputDriverType_Count);
|
|
|
|
ms_registry[type] = func;
|
|
}
|
|
|
|
GpInputDriverFactory::FactoryFunc_t GpInputDriverFactory::ms_registry[EGpInputDriverType_Count];
|