Public Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
openni::OpenNI::DeviceConnectedListener Class Referenceabstract

#include <OpenNI.h>

Public Member Functions

 DeviceConnectedListener ()
 
virtual void onDeviceConnected (const DeviceInfo *)=0
 
virtual ~DeviceConnectedListener ()
 

Static Private Member Functions

static void ONI_CALLBACK_TYPE deviceConnectedCallback (const OniDeviceInfo *pInfo, void *pCookie)
 

Private Attributes

OniDeviceCallbacks m_deviceConnectedCallbacks
 
OniCallbackHandle m_deviceConnectedCallbacksHandle
 

Friends

class OpenNI
 

Detailed Description

The OpenNI::DeviceConnectedListener class provides a means of registering for, and responding to when a device is connected.

onDeviceConnected is called whenever a new device is connected to the system (ie this event would be triggered when a new sensor is manually plugged into the host system running the application)

To use this class, you should write a new class that inherits from it, and override the onDeviceConnected method. Once you instantiate your class, use the OpenNI::addDeviceConnectedListener() function to add your listener object to OpenNI's list of listeners. Your handler function will then be called whenever the event occurs. A OpenNI::removeDeviceConnectedListener() function is also provided, if you want to have your class stop listening to these events for any reason.

Definition at line 1955 of file OpenNI.h.

Constructor & Destructor Documentation

openni::OpenNI::DeviceConnectedListener::DeviceConnectedListener ( )
inline

Definition at line 1958 of file OpenNI.h.

virtual openni::OpenNI::DeviceConnectedListener::~DeviceConnectedListener ( )
inlinevirtual

Definition at line 1966 of file OpenNI.h.

Member Function Documentation

static void ONI_CALLBACK_TYPE openni::OpenNI::DeviceConnectedListener::deviceConnectedCallback ( const OniDeviceInfo pInfo,
void *  pCookie 
)
inlinestaticprivate

Definition at line 1983 of file OpenNI.h.

virtual void openni::OpenNI::DeviceConnectedListener::onDeviceConnected ( const DeviceInfo )
pure virtual

Callback function for the onDeviceConnected event. This function will be called whenever this event occurs. When this happens, a pointer to the DeviceInfo object for the newly connected device will be supplied. Note that once a device is removed, if it was opened by a Device object, that object can no longer be used to access the device, even if it was reconnected. Once a device was reconnected, Device::open() should be called again in order to use this device.

If you wish to open the new device as it is connected, simply query the provided DeviceInfo object to obtain the URI of the device, and pass this URI to the Device.Open() function.

Friends And Related Function Documentation

friend class OpenNI
friend

Definition at line 1989 of file OpenNI.h.

Member Data Documentation

OniDeviceCallbacks openni::OpenNI::DeviceConnectedListener::m_deviceConnectedCallbacks
private

Definition at line 1990 of file OpenNI.h.

OniCallbackHandle openni::OpenNI::DeviceConnectedListener::m_deviceConnectedCallbacksHandle
private

Definition at line 1991 of file OpenNI.h.


The documentation for this class was generated from the following file:


libfreenect
Author(s): Hector Martin, Josh Blake, Kyle Machulis, OpenKinect community
autogenerated on Thu Jun 6 2019 19:25:39