![]() |
ImFusion C++ SDK 4.5.0
|
#include <ImFusion/Core/SubPropertyList.h>
The SubPropertyList class represents nested records of Configurable entities. More...
The SubPropertyList class represents nested records of Configurable entities.
It is very similar to SubProperty, with the addition that you can store multiple Configurable entities for which it also offers functionality to conveniently access them. The SubPropertyList class provides functions like the index operator, for easy access of the nested elements:
The nested objects are stored as multiple sub-properties inside the given Properties preserving the order and using the name of the SubPropertyList.
The signal signalValueChanged is only emitted whenever the nested objects are changed using setValue(), configure(), or if one of their Configurable::signalParametersChanged was emitted.
Note: In contrast to SubProperty, SubPropertyList currently only supports T being a regular value type implementing Configurable.
| T | Underlying type of the parameter, must be default-constructible, copyable and implement the Configurable interface. |
Public Types | |
| using | Iterator = typename std::vector<T>::iterator |
| using | ConstIterator = typename std::vector<T>::const_iterator |
Public Member Functions | |
| SubPropertyList (const std::string &name, const std::vector< T > &init, Configurable *parent=nullptr) | |
| Creates a SubPropertyList that will be configured under the given name and with the given initial value. | |
| SubPropertyList (const std::string &name, const std::vector< T > &init, Configurable &parent) | |
| SubPropertyList (const SubPropertyList< T > &other) | |
| SubPropertyList (SubPropertyList< T > &&other) noexcept | |
| SubPropertyList< T > & | operator= (const SubPropertyList< T > &other) |
| Assigns the value and attributes from another SubPropertyList instance of the same type and emits signalValueChanged. | |
| SubPropertyList< T > & | operator= (SubPropertyList< T > &other) |
| Assigns the value and attributes from another SubPropertyList instance of the same type and emits signalValueChanged. | |
| SubPropertyList< T > & | operator= (SubPropertyList< T > &&other) noexcept |
| Assigns the value and attributes from another SubPropertyList instance of the same type and emits signalValueChanged. | |
| SubPropertyList< T > & | operator= (const std::vector< T > &value) |
| Assign a new value to this SubPropertyList, emits signalValueChanged. | |
| void | setValue (const std::vector< T > &value) |
| Assign a new value to this SubPropertyList, emits signalValueChanged. | |
| SubPropertyList< T > & | append (T &&value) |
| Append a new value to this SubPropertyList, emits signalValueChanged. | |
| SubPropertyList< T > & | insert (Iterator position, T &&value) |
| Inserts a new value into this SubPropertyList before position, emits signalValueChanged. | |
| Iterator | erase (Iterator position) |
| Erases the element at position. | |
| Iterator | erase (ConstIterator position) |
| Iterator | erase (Iterator first, Iterator last) |
| Erases the elements in the range [first, last). | |
| Iterator | erase (ConstIterator first, ConstIterator last) |
| void | clear () |
| Removes all elements from the container. | |
| auto | begin () const noexcept |
| Returns an iterator to the first element. | |
| auto | begin () noexcept |
| ConstIterator | cbegin () const noexcept |
| Returns a const iterator to the first element. | |
| auto | end () const noexcept |
| Returns an iterator to one past the last element. | |
| auto | end () noexcept |
| ConstIterator | cend () const noexcept |
| Returns a const iterator to one past the last element. | |
| T & | front () noexcept |
| Returns a reference to the first element in the container. | |
| const T & | front () const noexcept |
| Returns a const reference to the first element in the container. | |
| T & | back () noexcept |
| Returns a reference to the last element in the container. | |
| const T & | back () const noexcept |
| Returns a const reference to the last element in the container. | |
| const auto & | operator[] (size_t pos) const |
| auto & | operator[] (size_t pos) |
| bool | empty () const |
| size_t | size () const |
| void | configure (const Properties *p) override |
| Configure this parameter/sub property by de-serializing the given Properties. | |
| void | configuration (Properties *p) const override |
| Serialize the current parameter/sub property state into the given Properties object. | |
| Public Member Functions inherited from ImFusion::ParameterBase | |
| ParameterBase (const std::string &name) | |
| const Configurable * | parent () const |
| Return the parent Configurable instance that this parameter is registered with. | |
| virtual const std::string & | name () const |
| Returns parameter name, can only be set during construction. | |
| void | setAttribute (const std::string &key, const std::string &value) |
| Add the given attribute key-value pair to the set of parameter attributes. | |
| void | removeAttribute (const std::string &key) |
| Remove the attribute with the given key. | |
| const std::map< std::string, std::string > & | attributes () const |
| Get the attribute map. | |
| void | setLabel (const std::string &label) |
| Sets an optional label for the Parameter if displayed in the UI. | |
| void | addDeprecatedName (const std::string &deprecatedName) |
| Adds an optional alternative parameter name that should be used for param lookup for during configure() in case de-serialization from m_name was not successful. | |
| const std::vector< std::string > & | deprecatedNames () const |
| Returns the list of deprecated parameter names that should be used for param lookup (see addDeprecatedName()). | |
| Public Member Functions inherited from ImFusion::SignalReceiver | |
| SignalReceiver ()=default | |
| Default constructor. | |
| SignalReceiver (const SignalReceiver &other) | |
| Copy constructor, does not copy any existing signal connections from other. | |
| SignalReceiver & | operator= (SignalReceiver rhs) |
| Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs. | |
| virtual | ~SignalReceiver () |
| Virtual destructor disconnects from all connected signals. | |
Protected Attributes | |
| std::vector< T > | m_value |
| Protected Attributes inherited from ImFusion::ParameterBase | |
| Configurable * | m_parent = nullptr |
| const std::string | m_name |
| std::vector< std::string > | m_deprecatedNames |
| std::map< std::string, std::string > | m_attributes |
Additional Inherited Members | |
| Public Attributes inherited from ImFusion::ParameterBase | |
| Signal | signalValueChanged |
| Signal gets emitted when the underlying value of the Parameter/SubProperty has changed (either through setValue() or configure()). | |
| Protected Member Functions inherited from ImFusion::ParameterBase | |
| void | setParentFromCopy (const ParameterBase &other) |
| Helper function to be called from a copy/move ctor in order to correctly set the parent relation ship to the new parent Configurable. | |
| Protected Member Functions inherited from ImFusion::SignalReceiver | |
| void | disconnectAll () |
| Disconnects all existing connections. | |
| ImFusion::SubPropertyList< T >::SubPropertyList | ( | const std::string & | name, |
| const std::vector< T > & | init, | ||
| Configurable * | parent = nullptr ) |
Creates a SubPropertyList that will be configured under the given name and with the given initial value.
If parent != nullptr creates a SubPropertyList that is directly registered to the parent Configurable instance. The parent instance is stored and thus must have a lifetime longer than this object.
| SubPropertyList< T > & ImFusion::SubPropertyList< T >::operator= | ( | const SubPropertyList< T > & | other | ) |
Assigns the value and attributes from another SubPropertyList instance of the same type and emits signalValueChanged.
Expects name and deprecated names to be the same and will not change the parent relationship.
| SubPropertyList< T > & ImFusion::SubPropertyList< T >::operator= | ( | SubPropertyList< T > & | other | ) |
Assigns the value and attributes from another SubPropertyList instance of the same type and emits signalValueChanged.
Expects name and deprecated names to be the same and will not change the parent relationship.
|
noexcept |
Assigns the value and attributes from another SubPropertyList instance of the same type and emits signalValueChanged.
Expects name and deprecated names to be the same and will not change the parent relationship.
|
inline |
Erases the element at position.
This function behaves like std::vector::erase(position). The iterator position must refer to a valid element within this container. Passing an invalid iterator or an iterator from a different container results in undefined behavior (as for standard library containers). Returns an iterator to the element that follows the erased element, or end() if the erased element was the last one. Emits signalValueChanged once.
|
inline |
Erases the elements in the range [first, last).
This function behaves like std::vector::erase(first, last). The iterators first and last must refer to a valid range within this container. Passing invalid iterators, iterators from a different container, or an invalid range results in undefined behavior (as for standard library containers). Returns an iterator to the element that follows the last removed element, or end() if last == end(). If first == last, no elements are erased, the container is not modified, and first is returned. Emits signalValueChanged once if at least one element is erased.
| void ImFusion::SubPropertyList< T >::clear | ( | ) |
Removes all elements from the container.
This function behaves like std::vector::clear(). After the call, size() == 0 and empty() == true. Emits signalValueChanged once if the container was non-empty.
|
noexcept |
Returns a reference to the first element in the container.
This function behaves like the standard library containers (e.g. std::vector::front()). The container must not be empty. Calling front() on an empty container results in undefined behavior (as with standard library containers). It is the caller's responsibility to ensure the container is non-empty, typically by checking empty() before calling front().
|
noexcept |
Returns a const reference to the first element in the container.
This function behaves like the standard library containers (e.g. std::vector::front()). The container must not be empty. Calling front() on an empty container results in undefined behavior (as with standard library containers). It is the caller's responsibility to ensure the container is non-empty, typically by checking empty() before calling front().
|
noexcept |
Returns a reference to the last element in the container.
This function behaves like the standard library containers (e.g. std::vector::back()). The container must not be empty. Calling back() on an empty container results in undefined behavior (as with standard library containers). It is the caller's responsibility to ensure the container is non-empty, typically by checking empty() before calling back().
|
noexcept |
Returns a const reference to the last element in the container.
This function behaves like the standard library containers (e.g. std::vector::back()). The container must not be empty. Calling back() on an empty container results in undefined behavior (as with standard library containers). It is the caller's responsibility to ensure the container is non-empty, typically by checking empty() before calling back().
|
overridevirtual |
Configure this parameter/sub property by de-serializing the given Properties.
The behavior of configure() is as follows:
Implements ImFusion::ParameterBase.
|
overridevirtual |
Serialize the current parameter/sub property state into the given Properties object.
Implements ImFusion::ParameterBase.