JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::TouchList< Type > Class Template Reference

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>

Collaboration diagram for juce::TouchList< Type >:

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...
 
TouchEntrybegin () noexcept
 Allows iterator access to the list of touch entries. More...
 
const TouchEntrybegin () 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...
 
TouchEntryend () noexcept
 Allows iterator access to the list of touch entries. More...
 
const TouchEntryend () const noexcept
 
const TouchEntryfind (const TouchSurface::Touch &touch) const noexcept
 If a touch is in the list, returns a pointer to the TouchEntry. More...
 
TouchEntryfind (const TouchSurface::Touch &touch) noexcept
 
Type & getValue (const TouchSurface::Touch &touch)
 Returns the user data object that corresponds to the given touch. More...
 
TouchEntryoperator[] (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< TouchEntrytouches
 

Detailed Description

template<typename Type>
class juce::TouchList< Type >

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}

Constructor & Destructor Documentation

◆ TouchList()

template<typename Type >
juce::TouchList< Type >::TouchList ( )
inline

Creates an empty touch list.

◆ ~TouchList()

template<typename Type >
juce::TouchList< Type >::~TouchList ( )
inline

Destructor.

Member Function Documentation

◆ begin() [1/2]

template<typename Type >
TouchEntry* juce::TouchList< Type >::begin ( )
inlinenoexcept

Allows iterator access to the list of touch entries.

References juce::TouchList< Type >::touches.

◆ begin() [2/2]

template<typename Type >
const TouchEntry* juce::TouchList< Type >::begin ( ) const
inlinenoexcept

◆ clear()

template<typename Type >
void juce::TouchList< Type >::clear ( )
inlinenoexcept

Resets all contents, doest not generate any call-backs.

References juce::TouchList< Type >::touches.

◆ contains()

template<typename Type >
bool juce::TouchList< Type >::contains ( const TouchSurface::Touch touch) const
inlinenoexcept

Returns true if a touch is already in the list.

References juce::TouchList< Type >::find().

Referenced by juce::TouchList< Type >::updateTouch().

◆ end() [1/2]

template<typename Type >
TouchEntry* juce::TouchList< Type >::end ( )
inlinenoexcept

Allows iterator access to the list of touch entries.

References juce::TouchList< Type >::touches.

◆ end() [2/2]

template<typename Type >
const TouchEntry* juce::TouchList< Type >::end ( ) const
inlinenoexcept

◆ find() [1/2]

template<typename Type >
const TouchEntry* juce::TouchList< Type >::find ( const TouchSurface::Touch touch) const
inlinenoexcept

◆ find() [2/2]

template<typename Type >
TouchEntry* juce::TouchList< Type >::find ( const TouchSurface::Touch touch)
inlinenoexcept

◆ getValue()

template<typename Type >
Type& juce::TouchList< Type >::getValue ( const TouchSurface::Touch touch)
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.

◆ matches()

template<typename Type >
static bool juce::TouchList< Type >::matches ( const TouchSurface::Touch t1,
const TouchSurface::Touch t2 
)
inlinestaticprivatenoexcept

◆ operator[]()

template<typename Type >
TouchEntry& juce::TouchList< Type >::operator[] ( const int  index)
inline

Retrieve a reference to particular item in the list of touch entires.

References juce::TouchList< Type >::touches.

◆ size()

template<typename Type >
int juce::TouchList< Type >::size ( ) const
inlinenoexcept

Returns the number of entries in the touch list.

References juce::TouchList< Type >::touches.

◆ updateTouch()

template<typename Type >
void juce::TouchList< Type >::updateTouch ( const TouchSurface::Touch touch)
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.

Member Data Documentation

◆ touches


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