JUCE
Classes | Public Member Functions | List of all members
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...

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...
 
int size () const noexcept
 Returns the number of entries in the touch list. More...
 
Type & getValue (const TouchSurface::Touch &touch)
 Returns the user data object that corresponds to the given touch. More...
 
bool contains (const TouchSurface::Touch &touch) const noexcept
 Returns true if a touch is already in the list. More...
 
void updateTouch (const TouchSurface::Touch &touch)
 Updates the entry for the given touch, copying in the new state. More...
 
TouchEntryfind (const TouchSurface::Touch &touch) const noexcept
 If a touch is in the list, returns a pointer to the TouchEntry. More...
 
TouchEntrybegin () const noexcept
 Allows iterator access to the list of touch entries. More...
 
TouchEntryend () const noexcept
 Allows iterator access to the list of touch entries. More...
 
TouchEntryoperator[] (const int index)
 Retrieve a reference to particular item in the list of touch entires. More...
 
void clear () noexcept
 Resets all contents, doest not generate any call-backs. More...
 

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.

Constructor & Destructor Documentation

§ TouchList()

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

Creates an empty touch list.

§ ~TouchList()

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

Destructor.

Member Function Documentation

§ size()

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

Returns the number of entries in the touch list.

§ getValue()

template<typename Type >
Type& juce::TouchList< Type >::getValue ( const TouchSurface::Touch touch)

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.

§ contains()

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

Returns true if a touch is already in the list.

§ updateTouch()

template<typename Type >
void juce::TouchList< Type >::updateTouch ( const TouchSurface::Touch touch)

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.

§ find()

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

If a touch is in the list, returns a pointer to the TouchEntry.

Otherwise, returns nullptr.

§ begin()

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

Allows iterator access to the list of touch entries.

§ end()

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

Allows iterator access to the list of touch entries.

§ operator[]()

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

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

§ clear()

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

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


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