ImFusion SDK 4.3
ElementwiseDataComponentList Class Reference

#include <ImFusion/Base/ElementwiseDataComponentList.h>

Class for managing multiple DataComponentLists for individual elements. More...

+ Inheritance diagram for ElementwiseDataComponentList:

Detailed Description

Class for managing multiple DataComponentLists for individual elements.

The purpose of the ElementwiseDataComponentList is to store individual DataComponentLists for a range of elements. Each element may store different DataComponent of the same type. The elements in question may be individual images in SharedImageSet, or frames of a TrackingSequence. For example, it is used for storing stream metadata, which may vary on a per-frame basis.

This class implements a basic copy-on-write pattern for de-duplication of DataComponents of consecutive elements.

See also
ElementwiseDataComponentData

Public Member Functions

 ElementwiseDataComponentList ()=default
 Creates a new ElementwiseDataComponentList for the given data.
 
 ElementwiseDataComponentList (const ElementwiseDataComponentList &rhs)
 
ElementwiseDataComponentListoperator= (const ElementwiseDataComponentList &rhs)
 
 ElementwiseDataComponentList (ElementwiseDataComponentList &&other) noexcept
 
ElementwiseDataComponentListoperator= (ElementwiseDataComponentList &&other) noexcept
 
void add (const DataComponentList &dcl)
 Add a new element with the given list of DataComponents.
 
void set (int index, const DataComponentList &dcl)
 Set the DataComponents of the specified index, growing the list if necessary.
 
DataComponentListmutableElement (int which)
 Returns a reference to the specified list, or an empty list if the index is outside the range.
 
const DataComponentListelement (int which) const
 Returns a const reference to the specified list, or an empty list if the index is outside the range.
 
void clear ()
 Clear all recorded data components.
 
int size () const
 Returns the number of DataComponentLists.
 
void removeElement (int index, int count=1)
 Remove count elements starting at the specified index.
 
void sortElements (const std::vector< int > &indexMap)
 Sort elements according to the provided index map.
 
void forEach (const std::function< void(DataComponentList &dcl)> &lambda)
 Perform an action on each stored DataComponentLists, regardless for how many elements each is valid for.
 
void configure (const Properties *p) override
 Configure this object instance by de-serializing the given Properties.
 
void configuration (Properties *p) const override
 Serialize the current object configuration into the given Properties object.
 
- Public Member Functions inherited from Configurable
virtual void configureDefaults ()
 Retrieve the properties of this object, replaces values with their defaults and sets it again.
 
void registerParameter (ParameterBase *param)
 Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration().
 
void unregisterParameter (const ParameterBase *param)
 Remove the given Parameter or SubProperty from the list of registered parameters.
 
 Configurable (const Configurable &rhs)
 
 Configurable (Configurable &&rhs) noexcept
 
Configurableoperator= (const Configurable &)
 
Configurableoperator= (Configurable &&) noexcept
 

Additional Inherited Members

- Public Attributes inherited from Configurable
Signal signalParametersChanged
 Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted.
 
- Protected Attributes inherited from Configurable
std::vector< Paramm_params
 List of all registered Parameter and SubProperty instances.
 

Member Function Documentation

◆ mutableElement()

DataComponentList & mutableElement ( int which)

Returns a reference to the specified list, or an empty list if the index is outside the range.

Note
The return value might be changed by the caller, which will invalidate the internal de-duplication scheme. Therefore, this function is more expensive than the const element() accessor as it may spawn internal copying.

◆ forEach()

void forEach ( const std::function< void(DataComponentList &dcl)> & lambda)

Perform an action on each stored DataComponentLists, regardless for how many elements each is valid for.

Helpful due to the otherwise hidden de-duplication scheme since element() is const, and performing changes using mutableElement() will cause duplication.

◆ configure()

void configure ( const Properties * p)
overridevirtual

Configure this object instance by de-serializing the given Properties.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configuration() for the inverse functionality

Reimplemented from Configurable.

◆ configuration()

void configuration ( Properties * p) const
overridevirtual

Serialize the current object configuration into the given Properties object.

The default implementation will do so automatically for all registered Parameter and SubProperty instances.

See also
configure() for the inverse functionality

Reimplemented from Configurable.


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