176 Construct<MessageHandlerImpl>(
Internal);
185 (
"~MessageHandler %p - Handler still active; call RemoveHandlerFromDevices",
this));
188 Destruct<MessageHandlerImpl>(handlerImpl);
214 return handlerImpl->
pLock;
343 devDesc->pNext = devDesc->pPrev = 0;
433 descKeepAlive->pDevice = 0;
453 for(devDesc =
Devices.GetFirst();
454 !
Devices.IsNull(devDesc); devDesc = devDesc->pNext)
465 factory = factory->pNext;
470 for(devDesc =
Devices.GetFirst();
471 !
Devices.IsNull(devDesc); devDesc = nextdevDesc)
474 nextdevDesc = devDesc->pNext;
505 !
Devices.IsNull(devDesc); devDesc = devDesc->pNext)
510 devDesc->Enumerated =
true;
511 if (!devDesc->pDevice)
520 bool newDevice =
false;
524 if (!descCandidate->
pDevice || newDevice)
526 return descCandidate;
550 for (devDesc =
Devices.GetFirst();
551 !
Devices.IsNull(devDesc); devDesc = devDesc->pNext)
565 for (devDesc =
Devices.GetFirst();
566 !
Devices.IsNull(devDesc); devDesc = devDesc->pNext)
590 factory = factory->pNext;
605 : pManager(manager), pFactory(factory) { }
609 pManager->AddDevice_NeedsLock(createDesc);
613 FactoryEnumerateVisitor newDeviceVisitor(
this, factory);
703 if (handleCount == 1)
717 lockKeepAlive =
pLock;
760 Desc->UpdateMatchedCandidate(createDesc);
void ReleaseLock(Lock *plock)
virtual bool GetDeviceInfo(DeviceInfo *info) const
virtual bool MatchHIDDevice(const HIDDeviceDesc &) const
virtual bool GetFeatureReport(UByte *data, UInt32 length)=0
virtual DeviceCreateDesc * Clone() const
void CallOnDeviceRemoved(DeviceCreateDesc *desc)
bool PushCall(R(C::*fn)(), bool wait=false)
bool RemoveHandler(MessageHandler *handler)
bool CompareAndSet_NoSync(T c, T val)
Void ReleaseDevice_MgrThread(DeviceBase *device)
virtual ~MessageHandler()
#define OVR_ASSERT_LOG(c, args)
virtual bool Initialize(DeviceBase *parent)=0
virtual DeviceManager * GetManager() const
virtual Ptr< DeviceCreateDesc > AddDevice_NeedsLock(const DeviceCreateDesc &createDesc)
virtual ThreadCommandQueue * GetThreadQueue()=0
MessageHandler * pHandlers[MaxHandlersCount]
Ptr< DeviceCreateDesc > pCreateDesc
Ptr< DeviceCreateDesc > FindDevice(const String &path, DeviceType=Device_None)
static ProfileManager * Create()
Lock * GetHandlerLock() const
Ptr< DeviceBase > pParent
Ptr< DeviceManagerLock > pLock
__END_NAMESPACE_STD char char __BEGIN_NAMESPACE_STD size_t strlen(const char *__s) __THROW __attribute_pure__ __nonnull((1))
void CallOnDeviceAdded(DeviceCreateDesc *desc)
virtual DeviceType GetType() const
virtual MatchResult MatchDevice(const DeviceCreateDesc &other, DeviceCreateDesc **pcandidate) const =0
void AddHandler_NTS(MessageHandler *handler)
virtual MatchResult MatchDevice(const DeviceCreateDesc &, DeviceCreateDesc **) const
MessageHandlerRef * pHandlerRefs[MaxHandlerRefsCount]
static void EnumerateHMDFromSensorDisplayInfo(const SensorDisplayInfoImpl &displayInfo, DeviceFactory::EnumerateVisitor &visitor)
virtual bool UpdateMatchedCandidate(const DeviceCreateDesc &desc, bool *newDeviceFlag=NULL)
DeviceManagerCreateDesc(DeviceFactory *factory)
virtual DeviceEnumerator EnumerateDevicesEx(const DeviceEnumerationArgs &args)
Ptr< ProfileManager > pProfileManager
DeviceManagerImpl * GetManagerImpl() const
void AddHandler(MessageHandler *handler)
bool IsDisconnected() const
char DisplayDeviceName[32]
enum _deviceType deviceType
virtual bool DetectHIDDevice(DeviceManager *pdevMgr, const HIDDeviceDesc &desc)
virtual DeviceBase * NewDeviceInstance()=0
Ptr< DeviceCreateDesc > FindHIDDevice(const HIDDeviceDesc &, bool created)
MessageHandlerRef(DeviceBase *device)
static const MessageHandlerImpl * FromHandler(const MessageHandler *handler)
virtual Void EnumerateFactoryDevices(DeviceFactory *factory)
static MessageHandlerImpl * FromHandler(MessageHandler *handler)
virtual DeviceBase * NewDeviceInstance()
static SharedLock MessageHandlerSharedLock
List< DeviceFactory > Factories
MessageHandlerRef HandlerRef
List< DeviceCreateDesc > Devices
virtual void Shutdown()=0
AtomicInt< UInt32 > HandleCount
virtual DeviceBase * GetParent() const
Lock * GetHandlerLock() const
DeviceEnumerator enumeratorFromHandle(const DeviceHandle &h, const DeviceEnumerationArgs &args)
virtual bool GetDeviceInfo(DeviceInfo *) const
bool removeHandler(int idx)
bool IsHandlerInstalled() const
friend class DeviceHandle
virtual DeviceCreateDesc * Clone() const =0
virtual DeviceCommon * getDeviceCommon() const =0
virtual void AddMessageHandler(MessageHandler *handler)
bool MatchRule(DeviceType type, bool available) const
void RemoveHandlerFromDevices()
void DetectHIDDevice(const HIDDeviceDesc &)
virtual Void EnumerateAllFactoryDevices()
virtual void RemovedFromManager()
void Call(const Message &msg)
virtual bool IsConnected()
virtual void EnumerateDevices(EnumerateVisitor &visitor)=0
HMDDevice * Disconnect(SensorDevice *)
DeviceBase * CreateDevice_MgrThread(DeviceCreateDesc *createDesc, DeviceBase *parent=0)
static DeviceCreateDesc * CreateManagerDesc()
volatile bool ConnectedFlag
#define OVR_COMPILER_ASSERT(x)
AtomicInt< UInt32 > RefCount
virtual bool Initialize(DeviceBase *parent)