GestureListΒΆ

GestureList Class Reference

The GestureList class represents a list of Gesture objects. More...

Inherits Interface.

Public Types

typedef ConstListIterator< GestureList, Gestureconst_iterator
 A C++ iterator type for GestureList objects. More...
 

Public Member Functions

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

Detailed Description

The GestureList class represents a list of Gesture objects.

Get a GestureList object from a Frame object.

Since
1.0

Member Typedef Documentation

typedef ConstListIterator<GestureList, Gesture> const_iterator

A C++ iterator type for GestureList objects.

Leap::GestureList gestures = frame.gestures();
for(Leap::GestureList::const_iterator gl = gestures.begin(); gl != gestures.end(); gl++)
std::cout << (*gl).toString() << std::endl;
Since
1.0

Constructor & Destructor Documentation

GestureList ( const ListBaseImplementation< Gesture > &  )

Constructs an empty gesture list.

Since
1.0

Member Function Documentation

GestureList& append ( const GestureList other)

Appends the members of the specified GestureList to this GestureList.

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

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

Leap::GestureList gestures = frame.gestures();
for(Leap::GestureList::const_iterator gl = gestures.begin(); gl != gestures.end(); gl++)
{
std::cout << (*gl).toString() << std::endl;
}
Since
1.0
int count ( ) const

The length of this list.

if (frame.gestures().count() > 0) {
//Process gestures...
}
Returns
The number of gestures in this list.
Since
1.0
const_iterator end ( ) const

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

Leap::GestureList gestures = frame.gestures();
for(Leap::GestureList::const_iterator gl = gestures.begin(); gl != gestures.end(); gl++)
std::cout << (*gl).toString() << std::endl;
Since
1.0
bool isEmpty ( ) const

Reports whether the list is empty.

if (!frame.gestures().isEmpty()) {
//Handle this frame's gesture objects
}
Returns
True, if the list has no members.
Since
1.0
Gesture operator[] ( int  index) const

Access a list member by its position in the list.

Leap::GestureList allGestures = frame.gestures();
Leap::Gesture firstGesture = allGestures[0];
Parameters
indexThe zero-based list position index.
Returns
The Gesture object at the specified index.
Since
1.0