ImFusion SDK 4.3
Selectable Class Referenceabstractthreadsafe

#include <ImFusion/Base/Selectable.h>

Interface for Data that supports having a Selection. More...

+ Inheritance diagram for Selectable:

Detailed Description

Interface for Data that supports having a Selection.

The interface is thread safe. However, when modified the signalSelectionChanged is emitted on the thread causing the modification.

Invariant
The implementations overriding any of the non-abstract methods must take care to acquire the mutex before accessing the underlying selection and emit the signalSelectionChanged on any change to the underlying selection.
Note
Threadsafe class: Member functions can be called concurrently from any thread.

Public Member Functions

 Selectable (const Selectable &)
 
 Selectable (Selectable &&)
 
Selectableoperator= (const Selectable &)
 
Selectableoperator= (Selectable &&)
 
virtual Selection selection () const
 
virtual int focus () const
 
virtual void setSelection (const Selection &sel)
 Set the underlying selection.
 
virtual void setFocus (int index)
 Set focus of the selection.
 
virtual int size () const =0
 

Public Attributes

ProtectedSignal signalSelectionChanged
 Signals that the selection or size might have changed.
 

Protected Attributes

std::mutex m_selectionMutex
 Mutex protecting the selection.
 
Selection m_sel
 

Member Function Documentation

◆ selection()

virtual Selection selection ( ) const
virtual
Returns
A copy of the underlying selection.

◆ focus()

virtual int focus ( ) const
virtual
Returns
The index of the focus of the selection.

◆ setSelection()

virtual void setSelection ( const Selection & sel)
virtual

Set the underlying selection.

Checks and clamps the index to be within the range defined by size(). Emits signalSelectionChanged if sel is different from the underlying selection.

Reimplemented in RGBDPlayback.

◆ setFocus()

virtual void setFocus ( int index)
virtual

Set focus of the selection.

Checks and clamps the index to be within the range defined by size(). Emits signalSelectionChanged if index is different from the underlying selection's focus.

Reimplemented in RGBDPlayback, and VideoFileStream.

◆ size()

virtual int size ( ) const
pure virtual

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close