|
xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
|
A vector that can be used to hold sub elements. More...
#include <xentara/workbench/skill/SubElementVector.hpp>
Inheritance diagram for xentara::workbench::skill::SubElementVector< Element, Allocator >:Public Types | |
| using | value_type = typename RawVector::value_type |
| The element type. | |
| using | allocator_type = typename RawVector::allocator_type |
| The Allocator type. | |
| using | size_type = typename RawVector::size_type |
| The type used for sizes. | |
| using | difference_type = typename RawVector::difference_type |
| The type used for distances. | |
| using | reference = typename RawVector::reference |
| A reference to an element. | |
| using | const_reference = typename RawVector::const_reference |
| A const reference to an element. | |
| using | pointer = typename RawVector::pointer |
| A pointer to an element. | |
| using | const_pointer = typename RawVector::const_pointer |
| A const pointer to an element. | |
| using | iterator = const_iterator |
| An iterator. | |
| using | const_iterator = typename RawVector::const_iterator |
| A const iterator. | |
| using | reverse_iterator = typename RawVector::reverse_iterator |
| An iterator for iterating in reverse order. | |
| using | const_reverse_iterator = typename RawVector::const_reverse_iterator |
| A const iterator for iterating in reverse order. | |
Public Member Functions | |
| auto | operator= (const SubElementVector &rhs) -> SubElementVector & |
| Assignment operator. | |
| auto | operator= (SubElementVector &&rhs) -> SubElementVector & |
| Move-Assignment operator. | |
| template<std::input_iterator InputIterator> | |
| auto | assign (size_type count, const SubElementPointer< Element > &value) -> void |
| Replaces the contents of the vector with copies of a specific element. | |
| template<std::input_iterator InputIterator> | |
| auto | assign (InputIterator first, InputIterator last) -> void |
| Copies a range of elements. | |
Constructors | |
| SubElementVector () noexcept(noexcept(Allocator {}))=default | |
| Default constructor. | |
| SubElementVector (const Allocator &allocator) | |
| Constructor that sets the allocator. | |
| SubElementVector (size_type size, const Allocator &allocator=Allocator()) | |
| Constructor that creates a vector of a certain size. | |
| SubElementVector (size_type size, const SubElementPointer< Element > &value, const Allocator &allocator=Allocator()) | |
| Constructor that fills the vector with copies of a specific element. | |
| template<std::input_iterator InputIterator> | |
| SubElementVector (InputIterator first, InputIterator last, const Allocator &allocator=Allocator()) | |
| Constructor that moves a range of elements. | |
| SubElementVector (const SubElementVector &other) | |
| Copy constructor. | |
| SubElementVector (SubElementVector &&other) | |
| Move constructor. | |
| SubElementVector (const SubElementVector &other, const std::type_identity_t< Allocator > &allocator) | |
| Copy constructor that uses a different allocator. | |
| SubElementVector (SubElementVector &&other, const std::type_identity_t< Allocator > &allocator) noexcept | |
| Move constructor that uses a different allocator. | |
Element Access | |
| auto | at (size_type index) const -> const_reference |
| Accesses the element at a certain index. | |
| auto | operator[] (size_type index) const noexcept -> const_reference |
| Subscript operator. | |
| auto | front () const noexcept -> const_reference |
| Returns the first element. | |
| auto | back () const noexcept -> const_reference |
| Returns the last element. | |
| auto | data () const noexcept -> const value_type * |
| Raw access to the data. | |
Iterators | |
| auto | begin () const noexcept -> const_iterator |
| Creates a begin iterator. | |
| auto | cbegin () const noexcept -> const_iterator |
| Creates a begin iterator. | |
| auto | end () const noexcept -> const_iterator |
| Creates an end iterator. | |
| auto | cend () const noexcept -> const_iterator |
| Creates an end iterator. | |
| auto | rbegin () const noexcept -> const_reverse_iterator |
| Creates a reverse begin iterator. | |
| auto | crbegin () const noexcept -> const_reverse_iterator |
| Creates a reverse begin iterator. | |
| auto | rend () const noexcept -> const_reverse_iterator |
| Creates a reverse end iterator. | |
| auto | crend () const noexcept -> const_reverse_iterator |
| Creates a reverse end iterator. | |
Size and Capacity | |
| auto | empty () const noexcept -> bool |
| Determines whether the data is empty. | |
| auto | size () const noexcept -> size_type |
| Gets the size of the data. | |
| auto | max_size () const noexcept -> size_type |
| Gets the maximum possible data size. | |
| auto | reserve (size_type capacity) -> void |
| Increases the capacity to a minimum value. | |
| auto | capacity () const noexcept -> size_type |
| Gets the capacity of the data. | |
| auto | shrink_to_fit () -> void |
| Reduces the capacity to the minimum required to hold the current elements, if the allocator supports it. | |
Modifiers | |
| auto | clear () noexcept -> void |
| Erases all elements. | |
| auto | insert (const_iterator where, const SubElementPointer< Element > &value) -> const_iterator |
| Inserts an element at a certain position. | |
| auto | insert (const_iterator where, SubElementPointer< Element > &&value) -> const_iterator |
| Move-Inserts an element at a certain position. | |
| auto | insert (const_iterator where, size_type count, const SubElementPointer< Element > &value) -> const_iterator |
| Inserts a number of copies of a element at a certain position. | |
| template<std::input_iterator InputIterator> | |
| auto | insert (const_iterator where, InputIterator first, InputIterator last) -> const_iterator |
| Inserts a range of values at a certain position. | |
| template<typename... Arguments> | |
| auto | emplace (const_iterator where, Arguments &&...arguments) -> const_iterator |
| Creates an element at a certain position. | |
| auto | erase (const_iterator position) -> const_iterator |
| Removes an element from the vector. | |
| auto | erase (const_iterator first, const_iterator last) -> const_iterator |
| Removes a range of elements from the vector. | |
| auto | push_back (const SubElementPointer< Element > &value) -> void |
| Appends an element to the back of the vector. | |
| auto | push_back (SubElementPointer< Element > &&value) -> void |
| Move-Appends an element to the back of the vector. | |
| template<typename... Arguments> | |
| auto | emplace_back (Arguments &&...arguments) -> const_reference |
| Appends a newly created element to the back of the vector. | |
| auto | pop_back () -> void |
| Removes the last element. | |
| auto | take (const_iterator position) -> std::pair< std::unique_ptr< Element >, const_iterator > |
| Removes an element from the vector and returns it. | |
| auto | take_back () -> std::unique_ptr< Element > |
| Removes the last element from the vector and returns it. | |
| auto | resize (size_type newSize) -> void |
| Resizes the vector. | |
| auto | resize (size_type newSize, const value_type &fillValue) -> void |
| Resizes the vector. | |
| auto | swap (SubElementVector &other) -> void |
| Swaps the contents of this vector with another vector. | |
Introspection | |
| auto | get_allocator () const -> allocator_type |
| Gets the allocator. | |
Public Member Functions inherited from xentara::workbench::bindings::PropertyContainer | |
| PropertyContainer () noexcept=default | |
| Default constructor. | |
| PropertyContainer (const PropertyContainer &other) | |
| Copy constructor. | |
| PropertyContainer (PropertyContainer &&other) noexcept | |
| Move constructor. | |
| auto | operator= (const PropertyContainer &rhs) -> PropertyContainer & |
| Copy assignment operator. | |
| auto | operator= (PropertyContainer &&rhs) noexcept -> PropertyContainer & |
| Move assignment operator that does not actually assign anything. | |
| virtual | ~PropertyContainer ()=0 |
| Virtual destructor. | |
| auto | setEnclosingPropertyContainer (PropertyContainer &enclosingContainer, SetEnclosingPropertyContainerOptions options={}) -> void |
| Sets the enclosing container. | |
| auto | resetEnclosingPropertyContainer (SetEnclosingPropertyContainerOptions options={}) -> void |
| Resets the enclosing container. | |
| auto | enclosingPropertyContainer () const -> PropertyContainer * |
| Gets the enclosing container. | |
| auto | propertyErrorCount () const -> std::size_t |
| Gets the number of error properties, including those of sub containers. | |
| template<std::invocable Callback> | |
| auto | subscribeToPropertyErrorCount (Callback &&callback) -> ErrorCountSubscription |
| Subscribes to a property. | |
| auto | forEachCrossReference (const ForEachCrossReferenceFunction &function, ForEachCrossReferenceOptions options={}) noexcept -> void |
| Calls a function for each cross reference contained within the container. | |
Private Member Functions | |
Virtual overrides for PropertyContainer | |
| auto | forEachSubPropertyContainer (const bindings::ForEachSubPropertyContainerFunction &function, bool includeInvisible) noexcept -> void final |
| Virtual override for PropertyContainer::forEachSubPropertyContainer() | |
| auto | forEachLocalCrossReference (const bindings::ForEachCrossReferenceFunction &function, bool includeInvisible) noexcept -> void final |
| Virtual override for PropertyContainer::forEachLocalCrossReference() | |
| auto | localPropertyErrorCount () const -> std::size_t final |
| Virtual override for bindings::PropertyContainer::localPropertyErrorCount() | |
| auto | propertyNotificationRaised (const bindings::PropertyId &propertyId) -> void final |
| Virtual override for PropertyContainer::propertyNotificationRaised() | |
Additional Inherited Members | |
Protected Member Functions inherited from xentara::workbench::bindings::PropertyContainer | |
| auto | subPropertyContainerAdded (const PropertyContainer &container) -> void |
| Must be called by derived classes if a sub container was added. | |
| auto | subPropertyContainerRemoved (const PropertyContainer &container) -> void |
| Must be called by derived classes if a sub container was removed. | |
| auto | subPropertyContainerListChanged (SubPropertyContainerListChangedOptions options={}) -> void |
| Must be called by derived classes if the list of sub containers changed completely. | |
| auto | subPropertyContainerListCopied (const PropertyContainer &other, SubPropertyContainerListChangedOptions options={}) -> void |
| Must be called by derived classes if the list of sub containers was copied from another container. | |
| auto | subPropertyContainerListMoved (PropertyContainer &other, SubPropertyContainerListChangedOptions options={}) -> void |
| Must be called by derived classes if the list of sub containers was moved from another container. | |
| auto | subPropertyContainerListSwapped (PropertyContainer &other, SubPropertyContainerListChangedOptions options={}) -> void |
| Must be called by derived classes if the list of sub containers was swapped with another container. | |
| auto | localPropertyErrorCountChanged () -> void |
| Must be called by derived classes if the value returned by localPropertyErrorCount() has changed. | |
| auto | raisePropertyNotification (const PropertyId &propertyId) const -> void |
| Passes a property notification to the enclosing container. | |
A vector that can be used to hold sub elements.
This vector adds a copy constructor and copy assignment operator to std::vector<std::unique_ptr>, that copy the objects held by the pointers
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::allocator_type = typename RawVector::allocator_type |
The Allocator type.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::const_iterator = typename RawVector::const_iterator |
A const iterator.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::const_pointer = typename RawVector::const_pointer |
A const pointer to an element.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::const_reference = typename RawVector::const_reference |
A const reference to an element.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::const_reverse_iterator = typename RawVector::const_reverse_iterator |
A const iterator for iterating in reverse order.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::difference_type = typename RawVector::difference_type |
The type used for distances.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::iterator = const_iterator |
An iterator.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::pointer = typename RawVector::pointer |
A pointer to an element.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::reference = typename RawVector::reference |
A reference to an element.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::reverse_iterator = typename RawVector::reverse_iterator |
An iterator for iterating in reverse order.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::size_type = typename RawVector::size_type |
The type used for sizes.
| using xentara::workbench::skill::SubElementVector< Element, Allocator >::value_type = typename RawVector::value_type |
The element type.
|
defaultnoexcept |
Default constructor.
Constructs an empty vector.
|
explicit |
Constructor that sets the allocator.
Constructs an empty vector.
| allocator | The allocator |
|
explicit |
Constructor that creates a vector of a certain size.
Creates a vector of the given size and fills it with default-constructed sub elements. The vector will be filled with pointers containing default-constructed sub elements, not with null pointers.
| size | The number of entries to create |
| allocator | The allocator |
|
explicit |
Constructor that fills the vector with copies of a specific element.
Creates a vector of the given size and fills it with the given value.
| size | The number of entries to create |
| value | The element to copy into the vector. Can be a null pointer. |
| allocator | The allocator |
| xentara::workbench::skill::SubElementVector< Element, Allocator >::SubElementVector | ( | InputIterator | first, |
| InputIterator | last, | ||
| const Allocator & | allocator = Allocator() |
||
| ) |
Constructor that moves a range of elements.
Creates a vector that holds copies of the given input range.
| first | The first element to copy |
| last | The position after the last element to copy |
| allocator | The allocator |
| xentara::workbench::skill::SubElementVector< Element, Allocator >::SubElementVector | ( | const SubElementVector< Element, Allocator > & | other | ) |
Copy constructor.
| other | The vector to copy |
| xentara::workbench::skill::SubElementVector< Element, Allocator >::SubElementVector | ( | SubElementVector< Element, Allocator > && | other | ) |
Move constructor.
| other | The vector from which to move the elements |
| xentara::workbench::skill::SubElementVector< Element, Allocator >::SubElementVector | ( | const SubElementVector< Element, Allocator > & | other, |
| const std::type_identity_t< Allocator > & | allocator | ||
| ) |
Copy constructor that uses a different allocator.
| other | The vector to copy |
| allocator | The allocator |
|
noexcept |
Move constructor that uses a different allocator.
| other | The vector from which to move the elements |
| allocator | The allocator |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::assign | ( | InputIterator | first, |
| InputIterator | last | ||
| ) | -> void |
Copies a range of elements.
Replaces the contents of the vector with a given input range.
| first | The first element to copy |
| last | The position after the last element to copy |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::assign | ( | size_type | count, |
| const SubElementPointer< Element > & | value | ||
| ) | -> void |
Replaces the contents of the vector with copies of a specific element.
Replaces the contents of the vector with copies of given element.
| count | The number of copies to create |
| value | The element to copy into the vector. Can be a null pointer. |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::at | ( | size_type | index | ) | const -> const_reference |
Accesses the element at a certain index.
| index | The index |
| std::out_of_range | index is out of range |
|
noexcept |
Returns the last element.
|
noexcept |
Creates a begin iterator.
|
noexcept |
Gets the capacity of the data.
|
noexcept |
Creates a begin iterator.
|
noexcept |
Creates an end iterator.
|
noexcept |
Erases all elements.
|
noexcept |
Creates a reverse begin iterator.
|
noexcept |
Creates a reverse end iterator.
|
noexcept |
Raw access to the data.
Returns a pointer to the underlying array that serves as element storage.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::emplace | ( | const_iterator | where, |
| Arguments &&... | arguments | ||
| ) | -> const_iterator |
Creates an element at a certain position.
| where | The desired position of the new element. Must be a position within the vector, or cend() to append the element. |
| arguments | The arguments to pass to the element's constructor |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::emplace_back | ( | Arguments &&... | arguments | ) | -> const_reference |
Appends a newly created element to the back of the vector.
| arguments | The arguments to pass to the element's constructor |
|
noexcept |
Determines whether the data is empty.
|
noexcept |
Creates an end iterator.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::erase | ( | const_iterator | first, |
| const_iterator | last | ||
| ) | -> const_iterator |
Removes a range of elements from the vector.
| first | An iterator to the first element to remove |
| last | An iterator one position past the last element to remove |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::erase | ( | const_iterator | position | ) | -> const_iterator |
Removes an element from the vector.
| position | The position of the element to remove. Must point to a valid element. |
|
finalprivatevirtualnoexcept |
Virtual override for PropertyContainer::forEachLocalCrossReference()
Implements xentara::workbench::bindings::PropertyContainer.
|
finalprivatevirtualnoexcept |
Virtual override for PropertyContainer::forEachSubPropertyContainer()
Implements xentara::workbench::bindings::PropertyContainer.
|
noexcept |
Returns the first element.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::get_allocator | ( | ) | const -> allocator_type |
Gets the allocator.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::insert | ( | const_iterator | where, |
| const SubElementPointer< Element > & | value | ||
| ) | -> const_iterator |
Inserts an element at a certain position.
| where | The desired position of the new element. Must be a position within the vector, or cend() to append the element. |
| value | The value to insert |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::insert | ( | const_iterator | where, |
| InputIterator | first, | ||
| InputIterator | last | ||
| ) | -> const_iterator |
Inserts a range of values at a certain position.
| where | The desired position of the first new element. Must be a position within the vector, or cend() to append the elements. |
| first | An iterator to the first value to insert |
| last | An iterator one position past the last value to insert |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::insert | ( | const_iterator | where, |
| size_type | count, | ||
| const SubElementPointer< Element > & | value | ||
| ) | -> const_iterator |
Inserts a number of copies of a element at a certain position.
| where | The desired position of the first new element. Must be a position within the vector, or cend() to append the elements. |
| count | The number of copies to insert |
| value | The value to insert |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::insert | ( | const_iterator | where, |
| SubElementPointer< Element > && | value | ||
| ) | -> const_iterator |
Move-Inserts an element at a certain position.
| where | The desired position of the new element. Must be a position within the vector, or cend() to append the element. |
| value | The value to move |
|
finalprivatevirtual |
Virtual override for bindings::PropertyContainer::localPropertyErrorCount()
Implements xentara::workbench::bindings::PropertyContainer.
|
noexcept |
Gets the maximum possible data size.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::operator= | ( | const SubElementVector< Element, Allocator > & | rhs | ) | -> SubElementVector & |
Assignment operator.
| rhs | The vector to copy |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::operator= | ( | SubElementVector< Element, Allocator > && | rhs | ) | -> SubElementVector & |
Move-Assignment operator.
| rhs | The vector from which to move the elements |
|
noexcept |
Subscript operator.
Returns a reference to the element at a certain index
| index | The index |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::pop_back | ( | ) | -> void |
Removes the last element.
|
finalprivatevirtual |
Virtual override for PropertyContainer::propertyNotificationRaised()
Implements xentara::workbench::bindings::PropertyContainer.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::push_back | ( | const SubElementPointer< Element > & | value | ) | -> void |
Appends an element to the back of the vector.
| value | The value to insert |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::push_back | ( | SubElementPointer< Element > && | value | ) | -> void |
Move-Appends an element to the back of the vector.
| value | The value to move |
|
noexcept |
Creates a reverse begin iterator.
|
noexcept |
Creates a reverse end iterator.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::reserve | ( | size_type | capacity | ) | -> void |
Increases the capacity to a minimum value.
| capacity | The minimum number of elements the vector should be able to hold without reallocation |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::resize | ( | size_type | newSize | ) | -> void |
Resizes the vector.
Grows or shrinks the vector to a new size. If the new size is greater than the old size, the new elements are filled with default-constructed sub elements. The new elements be filled with pointers containing default-constructed sub elements, not with null pointers.
| newSize | The new size for the vector. |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::resize | ( | size_type | newSize, |
| const value_type & | fillValue | ||
| ) | -> void |
Resizes the vector.
Grows or shrinks the vector to a new size. If the new size is greater than the old size, the new elements are filled with copies of fillValue.
| newSize | The new size for the vector. |
| fillValue | The value that should be used to initialize new element. |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::shrink_to_fit | ( | ) | -> void |
Reduces the capacity to the minimum required to hold the current elements, if the allocator supports it.
|
noexcept |
Gets the size of the data.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::swap | ( | SubElementVector< Element, Allocator > & | other | ) | -> void |
Swaps the contents of this vector with another vector.
This function will propagate any exception thrown when swapping or transferring the individual elements. It does not have a strong exception guarantee, however: if an exception is thrown, both vectors will remain in a valid but unspecified state.
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::take | ( | const_iterator | position | ) | -> std::pair<std::unique_ptr<Element>, const_iterator> |
Removes an element from the vector and returns it.
| position | The position of the element to remove. Must point to a valid element. |
| auto xentara::workbench::skill::SubElementVector< Element, Allocator >::take_back | ( | ) | -> std::unique_ptr<Element> |
Removes the last element from the vector and returns it.