openni::OpenNI::DeviceConnectedListener Class Referenceabstract

`#include <OpenNI.h>`

## Public Member Functions

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

## 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.

## Constructor & Destructor Documentation

## DeviceConnectedListener()

openni::OpenNI::DeviceConnectedListener::DeviceConnectedListener | ( |  | ) |

inline

## ~DeviceConnectedListener()

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

inline virtual

## Member Function Documentation

## onDeviceConnected()

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 Symbol Documentation

## OpenNI

friend class OpenNI

friend

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

- OpenNI.h