ImFusion C++ SDK 4.4.0
ImFusion::Selectable Class Referenceabstractthreadsafe

#include <ImFusion/Base/Selectable.h>

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

Inheritance diagram for ImFusion::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 &&)
Selectable & operator= (const Selectable &)
Selectable & operator= (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 ImFusion::Selectable::selection ( ) const
virtual
Returns
A copy of the underlying selection.

◆ focus()

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

◆ setSelection()

virtual void ImFusion::Selectable::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 ImFusion::RGBDPlayback.

◆ setFocus()

virtual void ImFusion::Selectable::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 ImFusion::RGBDPlayback, and ImFusion::VideoFileStream.

◆ size()


The documentation for this class was generated from the following file:
  • ImFusion/Base/Selectable.h
Search Tab / S to search, Esc to close