DeviceListΒΆ

The DeviceList class represents a list of Device objects. More...

Inherits Interface.

Public Types

typedef ConstListIterator< DeviceList, Device > const_iterator
 A C++ iterator type for the DeviceList class. More...
 

Public Member Functions

DeviceList & append (const DeviceList &other)
 Appends the members of the specified DeviceList to this DeviceList. More...
 
const_iterator begin () const
 The C++ iterator set to the beginning of this DeviceList. More...
 
int count () const
 Returns the number of devices in this list. More...
 
 DeviceList (const ListBaseImplementation< Device > &)
 
 DeviceList ()
 Constructs an empty list of devices. More...
 
const_iterator end () const
 The C++ iterator set to the end of this DeviceList. More...
 
bool isEmpty () const
 Reports whether the list is empty. More...
 
Device operator[] (int index) const
 Access a list member by its position in the list. More...
 

Detailed Description

The DeviceList class represents a list of Device objects.

Get a DeviceList object by calling Controller::devices().

Since
1.0

Member Typedef Documentation

typedef ConstListIterator<DeviceList, Device> const_iterator

A C++ iterator type for the DeviceList class.

Since
1.0

Constructor & Destructor Documentation

DeviceList ( const ListBaseImplementation< Device > &  )

Constructs an empty list of devices.

Since
1.0

Member Function Documentation

DeviceList& append ( const DeviceList &  other)

Appends the members of the specified DeviceList to this DeviceList.

Parameters
otherA DeviceList object containing Device objects to append to the end of this DeviceList.
Since
1.0
const_iterator begin ( ) const

The C++ iterator set to the beginning of this DeviceList.

Since
1.0
int count ( ) const

Returns the number of devices in this list.

Returns
The number of devices in this list.
Since
1.0
const_iterator end ( ) const

The C++ iterator set to the end of this DeviceList.

Since
1.0
bool isEmpty ( ) const

Reports whether the list is empty.

if(!controller.devices().isEmpty())
Leap::Device leapDevice = controller.devices()[0];
Returns
True, if the list has no members.
Since
1.0
Device operator[] ( int  index) const

Access a list member by its position in the list.

Parameters
indexThe zero-based list position index.
Returns
The Device object at the specified index.
Since
1.0