Utility class to hold a list of TouchSurface::Touch objects with different indices and blockUIDs, where each touch has a mapping to some kind of user-supplied data value. More...
#include <juce_TouchList.h>
Classes | |
struct | TouchEntry |
Holds the current state of a touch, along with the user-data associated with it. More... | |
Public Member Functions | |
TouchList () | |
Creates an empty touch list. More... | |
~TouchList () | |
Destructor. More... | |
TouchEntry * | begin () noexcept |
Allows iterator access to the list of touch entries. More... | |
const TouchEntry * | begin () const noexcept |
void | clear () noexcept |
Resets all contents, doest not generate any call-backs. More... | |
bool | contains (const TouchSurface::Touch &touch) const noexcept |
Returns true if a touch is already in the list. More... | |
TouchEntry * | end () noexcept |
Allows iterator access to the list of touch entries. More... | |
const TouchEntry * | end () const noexcept |
const TouchEntry * | find (const TouchSurface::Touch &touch) const noexcept |
If a touch is in the list, returns a pointer to the TouchEntry. More... | |
TouchEntry * | find (const TouchSurface::Touch &touch) noexcept |
Type & | getValue (const TouchSurface::Touch &touch) |
Returns the user data object that corresponds to the given touch. More... | |
TouchEntry & | operator[] (const int index) |
Retrieve a reference to particular item in the list of touch entires. More... | |
int | size () const noexcept |
Returns the number of entries in the touch list. More... | |
void | updateTouch (const TouchSurface::Touch &touch) |
Updates the entry for the given touch, copying in the new state. More... | |
Static Private Member Functions | |
static bool | matches (const TouchSurface::Touch &t1, const TouchSurface::Touch &t2) noexcept |
Private Attributes | |
juce::Array< TouchEntry > | touches |
Utility class to hold a list of TouchSurface::Touch objects with different indices and blockUIDs, where each touch has a mapping to some kind of user-supplied data value.
The Type template is a user-defined type of object that will be stored for each touch element. The type must be default-constructable and copyable.
{Blocks}
|
inline |
Creates an empty touch list.
|
inline |
Destructor.
|
inlinenoexcept |
Allows iterator access to the list of touch entries.
References juce::TouchList< Type >::touches.
|
inlinenoexcept |
References juce::TouchList< Type >::touches.
|
inlinenoexcept |
Resets all contents, doest not generate any call-backs.
References juce::TouchList< Type >::touches.
|
inlinenoexcept |
Returns true if a touch is already in the list.
References juce::TouchList< Type >::find().
Referenced by juce::TouchList< Type >::updateTouch().
|
inlinenoexcept |
Allows iterator access to the list of touch entries.
References juce::TouchList< Type >::touches.
|
inlinenoexcept |
References juce::TouchList< Type >::touches.
|
inlinenoexcept |
If a touch is in the list, returns a pointer to the TouchEntry.
Otherwise, returns nullptr.
References juce::TouchList< Type >::matches(), juce::TouchList< Type >::TouchEntry::touch, and juce::TouchList< Type >::touches.
Referenced by juce::TouchList< Type >::contains(), juce::TouchList< Type >::find(), juce::TouchList< Type >::getValue(), and juce::TouchList< Type >::updateTouch().
|
inlinenoexcept |
|
inline |
Returns the user data object that corresponds to the given touch.
This will also update the stored state of the TouchEntry::touch value for this touch index.
References juce::TouchList< Type >::find(), and juce::TouchList< Type >::touches.
|
inlinestaticprivatenoexcept |
Referenced by juce::TouchList< Type >::find(), and juce::TouchList< Type >::updateTouch().
|
inline |
Retrieve a reference to particular item in the list of touch entires.
References juce::TouchList< Type >::touches.
|
inlinenoexcept |
Returns the number of entries in the touch list.
References juce::TouchList< Type >::touches.
|
inline |
Updates the entry for the given touch, copying in the new state.
If no entry with the same index and blockUID exists then a new entry is created. If given a touch which is a touch-end, this will remove any corresponding entries from the list.
References juce::TouchList< Type >::contains(), juce::TouchList< Type >::find(), juce::TouchSurface::Touch::isTouchEnd, jassert, juce::TouchList< Type >::matches(), and juce::TouchList< Type >::touches.
|
private |