Leap Motion C++ API Reference  0.8.0
Leap::ToolList Class Reference

The ToolList class represents a list of Tool objects. More...

Inherits Leap::Interface.

Public Types

typedef ConstListIterator
< ToolList, Tool
const_iterator
 A C++ iterator type for ToolList objects.
 

Public Member Functions

ToolListappend (const ToolList &other)
 Appends the members of the specifed ToolList to this ToolList.
 
const_iterator begin () const
 The C++ iterator set to the beginning of this ToolList.
 
int count () const
 Returns the number of tools in this list.
 
bool empty () const
 Deprecated.
 
const_iterator end () const
 The C++ iterator set to the end of this ToolList.
 
Tool frontmost () const
 The member of the list that is farthest to the front within the standard Leap Motion frame of reference (i.e has the smallest Z coordinate).
 
bool isEmpty () const
 Reports whether the list is empty.
 
Tool leftmost () const
 The member of the list that is farthest to the left within the standard Leap Motion frame of reference (i.e has the smallest X coordinate).
 
Tool operator[] (int index) const
 Access a list member by its position in the list.
 
Tool rightmost () const
 The member of the list that is farthest to the right within the standard Leap Motion frame of reference (i.e has the largest X coordinate).
 
 ToolList ()
 Constructs an empty list of tools.
 

Detailed Description

The ToolList class represents a list of Tool objects.

Get a ToolList object by calling Frame::tools().

Member Typedef Documentation

typedef ConstListIterator<ToolList, Tool> Leap::ToolList::const_iterator

A C++ iterator type for ToolList objects.

Constructor & Destructor Documentation

Leap::ToolList::ToolList ( )

Constructs an empty list of tools.

Member Function Documentation

ToolList& Leap::ToolList::append ( const ToolList other)

Appends the members of the specifed ToolList to this ToolList.

Parameters
otherA ToolList object containing Tool objects to append to the end of this ToolList.
const_iterator Leap::ToolList::begin ( ) const

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

int Leap::ToolList::count ( ) const

Returns the number of tools in this list.

Returns
The number of tools in this list.
bool Leap::ToolList::empty ( ) const

Deprecated.

Use ToolList::isEmpty() instead.

See Also
ToolList::isEmpty()
const_iterator Leap::ToolList::end ( ) const

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

Tool Leap::ToolList::frontmost ( ) const

The member of the list that is farthest to the front within the standard Leap Motion frame of reference (i.e has the smallest Z coordinate).

Returns
The frontmost tool, or invalid if list is empty.
bool Leap::ToolList::isEmpty ( ) const

Reports whether the list is empty.

Returns
True, if the list has no members.
Tool Leap::ToolList::leftmost ( ) const

The member of the list that is farthest to the left within the standard Leap Motion frame of reference (i.e has the smallest X coordinate).

Returns
The leftmost tool, or invalid if list is empty.
Tool Leap::ToolList::operator[] ( int  index) const

Access a list member by its position in the list.

Parameters
indexThe zero-based list position index.
Returns
The Tool object at the specified index.
Tool Leap::ToolList::rightmost ( ) const

The member of the list that is farthest to the right within the standard Leap Motion frame of reference (i.e has the largest X coordinate).

Returns
The rightmost tool, or invalid if list is empty.