xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::layout::arranged_element_collection< type_t, sorter_t > Class Template Reference
Inheritance diagram for xtd::forms::layout::arranged_element_collection< type_t, sorter_t >:
xtd::object

Definition

template<class type_t, class sorter_t = sorter_none>
class xtd::forms::layout::arranged_element_collection< type_t, sorter_t >

Represents a collection of objects.

Header
#include <xtd/forms/layout/arranged_element_collection>
Namespace
xtd::forms::layout
Library
xtd.forms
Remarks
The xtd::forms::layout::arranged_element_collection class represents a collection of objects arranged on a design surface or inside a parent xtd.forms::container_control.
xtd::forms::layout::arranged_element_collection inherits from xtd::collections::generic::icollection instead of xtd::collections::generic::ilistto allow operator[] to return value_type, which triggers updates and events on element changes.
Returning type_t& would bypass these updates, while returning value_type& would break the xtd::collections::generic::ilist interface.
This keeps the collection safe and consistent, while most developers can still use xtd::forms::layout::arranged_element_collection::add_range() or xtd::forms::layout::arranged_element_collection::operator[] as expected.

Classes

class  value_type
 Represents the value type of the collection. More...
 

Public Aliases

using base_type
 Represents the list base type.
 
using const_base_type
 Represents the list base type.
 
using size_type
 Represents the list size type (usually xtd::size).
 
using reference
 Represents the reference of list value type.
 
using const_reference
 Represents the const reference of list value type.
 
using pointer
 Represents the pointer of list value type.
 
using const_pointer
 Represents the const pointer of list value type.
 
using read_only_collection
 Represents the read only collection of of list.
 

Public Fields

static constexpr xtd::size npos
 Represents a value that is not a valid position in a collection.
 
static constexpr xtd::size bpos
 Represents the index of the first valid element in a collection.
 
static constexpr xtd::size epos
 Represents the index of the last valid element in a collection.
 

Public Events

event< arranged_element_collection, delegate< void(size_t, type_t &item)> > item_added
 Occurs when an item is added to the collection.
 
event< arranged_element_collection, delegate< void(size_t, type_t &item)> > item_updated
 Occurs when an item is updated in the collection.
 
event< arranged_element_collection, delegate< void(size_t, type_t &item)> > item_removed
 Occurs when an item is removed from the collection.
 

Public Constructors

 arranged_element_collection ()=default
 Initializes a new instance of the xtd::forms::layout::arranged_element_collection class that is empty.
 
 arranged_element_collection (size_type capacity)
 Constructs the container with specified count default-inserted instances of type_t. No copies are made.
 
 arranged_element_collection (const xtd::collections::generic::ienumerable< type_t > &collection)
 Initializes a new instance of the xtd::forms::layout::arranged_element_collection <type_t> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.
 
 arranged_element_collection (const arranged_element_collection &collection)
 Default copy constructor with specified list.
 
 arranged_element_collection (arranged_element_collection &&collection)
 Move constructor with specified list.
 
 arranged_element_collection (const base_type &collection)
 Copy constructor with specified base type list.
 
 arranged_element_collection (base_type &&collection)
 Move constructor with specified base type list.
 
 arranged_element_collection (std::initializer_list< type_t > items)
 Constructs the container with the contents of the specified initializer list, and allocator.
 
template<std::input_iterator input_iterator_t>
 arranged_element_collection (input_iterator_t first, input_iterator_t last)
 Constructs the container with the contents of the range [first, last).
 

Public Properties

size_type capacity () const noexcept
 Gets the total number of elements the internal data structure can hold without resizing.
 
void capacity (size_type value)
 Sets the total number of elements the internal data structure can hold without resizing.
 
size_type count () const noexcept override
 Gets the number of elements contained in the xtd::forms::layout::arranged_element_collection <type_t>.
 
pointer data ()
 Direct access to the underlying array.
 
const_pointer data () const
 Direct access to the underlying array.
 
const auto & items () const
 Returns the underlying base type items.
 
auto & items ()
 Returns the underlying base type items.
 
virtual bool sorted () const noexcept
 Checks whether the container is sorted.
 
virtual arranged_element_collectionsorted (bool value)
 Sets the container is sorted.
 

Public Methods

void add (const type_t &item) override
 Adds an item to the xtd::forms::layout::arranged_element_collection <type_t>.
 
virtual void add (type_t &&item)
 Adds an item to the xtd::forms::layout::arranged_element_collection <type_t>.
 
virtual void add_range (const arranged_element_collection &collection)
 Adds elements to the end.
 
virtual void add_range (const std::vector< type_t > &collection)
 Adds elements to the end.
 
virtual void add_range (const std::initializer_list< type_t > &collection)
 Adds elements to the end.
 
template<class collection_t>
void add_range (collection_t &&collection)
 Adds elements to the end.
 
template<class collection_t>
void add_range (const collection_t &collection)
 Adds elements to the end.
 
void clear () override
 Removes all items from the xtd::forms::layout::arranged_element_collection <type_t>.
 
bool contains (const type_t &item) const noexcept override
 Determines whether the xtd::forms::layout::arranged_element_collection <type_t> contains a specific value.
 
void copy_to (xtd::array< type_t > &array, xtd::size array_index) const override
 Copies the elements of the xtd::forms::layout::arranged_element_collection <type_t> to an xtd::array, starting at a particular xtd::array index.
 
xtd::collections::generic::enumerator< type_t > get_enumerator () const noexcept override
 Returns an enumerator that iterates through the xtd::forms::layout::arranged_element_collection <type_t>.
 
virtual void insert (xtd::size index, const type_t &value)
 Inserts specified element at specified index.
 
virtual arranged_element_collectionsort ()
 Sorts the content.
 
bool remove (const type_t &item) override
 Removes the first occurrence of a specific object from the xtd::forms::layout::arranged_element_collection <type_t>.
 
virtual void remove_at (size_t index)
 Erases element at specified index.
 
xtd::array< type_t > to_array () const noexcept
 Gets an array with the elements of the container.
 

Public Operators

arranged_element_collectionoperator= (const arranged_element_collection &other)
 Copy assignment operator. Replaces the contents with a copy of the contents of other.
 
arranged_element_collectionoperator= (arranged_element_collection &&other) noexcept
 Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in a valid but unspecified state afterwards.
 
arranged_element_collectionoperator= (const std::initializer_list< type_t > &items)
 Replaces the contents with those identified by initializer list ilist.
 
value_typeoperator[] (size_type index)
 Access specified element.
 
const value_typeoperator[] (size_type index) const
 Access specified element.
 
 operator const_base_type & () const noexcept
 Returns a reference to the underlying base type.
 
 operator base_type & () noexcept
 Returns a reference to the underlying base type.
 
bool operator== (const arranged_element_collection &value) const
 
bool operator!= (const arranged_element_collection &value) const
 

Public Deprecatd Properties

size_type max_size () const noexcept
 Returns the maximum possible number of elements.
 

Public Deprecated Methods

reference at (size_type pos)
 Access specified element with bounds checking.
 
const_reference at (size_type pos) const
 Access specified element with bounds checking.
 
reference back ()
 Access the last element.
 
const_reference back () const
 Access the last element.
 
const_reverse_iterator crbegin () const noexcept
 Returns a reverse iterator to the end.
 
const_reverse_iterator crend () const noexcept
 Returns a reverse iterator to the end.
 
reference front ()
 Access the first element.
 
const_reference front () const
 Access the first element.
 
auto get_allocator () const noexcept
 Returns the associated allocator.
 
template<class ... args_t>
void emplace (xtd::collections::generic::list< value_type >::const_iterator pos, args_t &&... args)
 Inserts specified element at specified position.
 
template<class ... args_t>
void emplace_back (args_t &&... args)
 Adds an element to the end.
 
auto erase (xtd::collections::generic::list< value_type >::iterator pos)
 Erases element at specified position.
 
auto erase (xtd::collections::generic::list< value_type >::const_iterator pos)
 Erases element at specified position.
 
auto erase (xtd::collections::generic::list< value_type >::iterator first, xtd::collections::generic::list< value_type >::iterator last)
 Erases elements at specified range.
 
auto erase (xtd::collections::generic::list< value_type >::const_iterator first, xtd::collections::generic::list< value_type >::const_iterator last)
 Erases elements at specified range.
 
void erase_at (size_t index)
 Erases element at specified index.
 
auto insert (xtd::collections::generic::list< value_type >::const_iterator pos, const type_t &value)
 Inserts specified element at specified position.
 
auto insert (xtd::collections::generic::list< value_type >::const_iterator pos, type_t &&value)
 Inserts specified element at specified position.
 
void insert_at (size_t index, const type_t &value)
 Inserts specified element at specified index.
 
void pop_back ()
 Removes the last element of the container.
 
void push_back (const type_t &item)
 Adds an element to the end.
 
void push_back (type_t &&item)
 Adds an element to the end.
 
void push_back_range (const arranged_element_collection &collection)
 Adds elements to the end.
 
void push_back_range (const std::vector< type_t > &collection)
 Adds elements to the end.
 
void push_back_range (const std::initializer_list< type_t > &collection)
 Adds elements to the end.
 
template<class collection_t>
void push_back_range (collection_t &&collection)
 Adds elements to the end.
 
template<class iterator_t>
void push_back_range (iterator_t begin, iterator_t end)
 Adds elements to the end.
 
std::vector< type_t > to_vector () const noexcept
 Gets an array with the elements of the container.
 
auto rbegin () noexcept
 Returns a reverse iterator to the end.
 
auto rbegin () const noexcept
 Returns a reverse iterator to the end.
 
auto rend () noexcept
 Returns a reverse iterator to the end.
 
auto rend () const noexcept
 Returns a reverse iterator to the end.
 
void reserve (size_type size)
 Reserves storage.
 
void shrink_to_fit ()
 Reduces memory usage by freeing unused memory.
 

Protected Methods

virtual void on_item_added (size_t index, type_t &item)
 Raises the xtd::forms::layout::arranged_element_collection::item_added event.
 
virtual void on_item_updated (size_t index, type_t &item)
 Raises the xtd::forms::layout::arranged_element_collection::item_updated event.
 
virtual void on_item_removed (size_t index, type_t &item)
 Raises the xtd::forms::layout::arranged_element_collection::item_removed event.
 

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual xtd::size get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<class object_t>
xtd::unique_ptr_object< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
template<class object_a_t, class object_b_t>
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<class object_a_t, class object_b_t>
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Member Typedef Documentation

◆ base_type

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::base_type

Represents the list base type.

◆ const_base_type

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::const_base_type

Represents the list base type.

◆ size_type

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::size_type

Represents the list size type (usually xtd::size).

◆ reference

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::reference

Represents the reference of list value type.

◆ const_reference

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::const_reference

Represents the const reference of list value type.

◆ pointer

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::pointer

Represents the pointer of list value type.

◆ const_pointer

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::const_pointer

Represents the const pointer of list value type.

◆ read_only_collection

template<class type_t, class sorter_t = sorter_none>
using xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::read_only_collection

Represents the read only collection of of list.

Constructor & Destructor Documentation

◆ arranged_element_collection() [1/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( )
default

Initializes a new instance of the xtd::forms::layout::arranged_element_collection class that is empty.

Examples
The following code example demonstrates the default constructor of the xtd::forms::layout::arranged_element_collection generic class. The default constructor creates a list with the default capacity, as demonstrated by displaying the xtd::forms::layout::arranged_element_collection::capacity property.
#include <xtd/xtd>
class example {
public:
static auto main() -> void {
auto dinosaurs = list<string> {};
console::write_line("\ncapacity: {0}", dinosaurs.capacity());
dinosaurs.add("Tyrannosaurus");
dinosaurs.add("Amargasaurus");
dinosaurs.add("Mamenchisaurus");
dinosaurs.add("Deinonychus");
dinosaurs.add("Compsognathus");
for (auto dinosaur : dinosaurs)
console::write_line("\ncapacity: {0}", dinosaurs.capacity());
console::write_line("count: {0}", dinosaurs.count());
console::write_line("\ncontains(\"Deinonychus\"): {0}", dinosaurs.contains("Deinonychus"));
console::write_line("\ninsert(2, \"Compsognathus\")");
dinosaurs.insert(2, "Compsognathus");
for (auto dinosaur : dinosaurs)
// Shows accessing the list using the Item property.
console::write_line("\ndinosaurs[3]: {0}", dinosaurs[3]);
console::write_line("\nremove(\"Compsognathus\")");
dinosaurs.remove("Compsognathus");
for (auto dinosaur : dinosaurs)
dinosaurs.trim_excess();
console::write_line("\ntrim_excess()");
console::write_line("capacity: {0}", dinosaurs.capacity());
console::write_line("count: {0}", dinosaurs.count());
dinosaurs.clear();
console::write_line("\nclear()");
console::write_line("capacity: {0}", dinosaurs.capacity());
console::write_line("count: {0}", dinosaurs.count());
}
};
startup_(example::main);
// This code produces the following output :
//
// capacity: 0
//
// Tyrannosaurus
// Amargasaurus
// Mamenchisaurus
// Deinonychus
// Compsognathus
//
// capacity: 8
// count: 5
//
// contains("Deinonychus"): true
//
// insert(2, "Compsognathus")
//
// Tyrannosaurus
// Amargasaurus
// Compsognathus
// Mamenchisaurus
// Deinonychus
// Compsognathus
//
// dinosaurs[3]: Mamenchisaurus
//
// remove("Compsognathus")
//
// Tyrannosaurus
// Amargasaurus
// Mamenchisaurus
// Deinonychus
// Compsognathus
//
// trim_excess()
// capacity: 5
// count: 5
// clear()
// capacity: 5
// count: 0
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
#define startup_(main_method)
Defines the entry point to be called when the application loads. Generally this is set either to the ...
Definition startup.hpp:168

◆ arranged_element_collection() [2/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( size_type capacity)
inlineexplicit

Constructs the container with specified count default-inserted instances of type_t. No copies are made.

Parameters
capacityThe number of elements that the new list can initially store.
Exceptions
xtd::out_of_memoryThere is not enough memory available on the system.
Examples
The following code example demonstrates the default constructor of the xtd::forms::layout::arranged_element_collection generic class. The default constructor creates a list with the default capacity, as demonstrated by displaying the xtd::forms::layout::arranged_element_collection::capacity property.
#include <xtd/xtd>
class example {
public:
static auto main() -> void {
auto dinosaurs = list<string> {};
console::write_line("\ncapacity: {0}", dinosaurs.capacity());
dinosaurs.add("Tyrannosaurus");
dinosaurs.add("Amargasaurus");
dinosaurs.add("Mamenchisaurus");
dinosaurs.add("Deinonychus");
dinosaurs.add("Compsognathus");
for (auto dinosaur : dinosaurs)
console::write_line("\ncapacity: {0}", dinosaurs.capacity());
console::write_line("count: {0}", dinosaurs.count());
console::write_line("\ncontains(\"Deinonychus\"): {0}", dinosaurs.contains("Deinonychus"));
console::write_line("\ninsert(2, \"Compsognathus\")");
dinosaurs.insert(2, "Compsognathus");
for (auto dinosaur : dinosaurs)
// Shows accessing the list using the Item property.
console::write_line("\ndinosaurs[3]: {0}", dinosaurs[3]);
console::write_line("\nremove(\"Compsognathus\")");
dinosaurs.remove("Compsognathus");
for (auto dinosaur : dinosaurs)
dinosaurs.trim_excess();
console::write_line("\ntrim_excess()");
console::write_line("capacity: {0}", dinosaurs.capacity());
console::write_line("count: {0}", dinosaurs.count());
dinosaurs.clear();
console::write_line("\nclear()");
console::write_line("capacity: {0}", dinosaurs.capacity());
console::write_line("count: {0}", dinosaurs.count());
}
};
startup_(example::main);
// This code produces the following output :
//
// capacity: 0
//
// Tyrannosaurus
// Amargasaurus
// Mamenchisaurus
// Deinonychus
// Compsognathus
//
// capacity: 8
// count: 5
//
// contains("Deinonychus"): true
//
// insert(2, "Compsognathus")
//
// Tyrannosaurus
// Amargasaurus
// Compsognathus
// Mamenchisaurus
// Deinonychus
// Compsognathus
//
// dinosaurs[3]: Mamenchisaurus
//
// remove("Compsognathus")
//
// Tyrannosaurus
// Amargasaurus
// Mamenchisaurus
// Deinonychus
// Compsognathus
//
// trim_excess()
// capacity: 5
// count: 5
// clear()
// capacity: 5
// count: 0

◆ arranged_element_collection() [3/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( const xtd::collections::generic::ienumerable< type_t > & collection)
inline

Initializes a new instance of the xtd::forms::layout::arranged_element_collection <type_t> class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.

Parameters
collectionThe collection whose elements are copied to the new list.
Examples
The following code example demonstrates the xtd::forms::layout::arranged_element_collection <type_t> constructor and various methods of the xtd::forms::layout::arranged_element_collection <type_t> class that act on ranges. An array of strings is created and passed to the constructor, populating the list with the elements of the array. The xtd::forms::layout::arranged_element_collection::capacity property is then displayed, to show that the initial capacity is exactly what is required to hold the input elements.
#include <xtd/xtd>
class example {
public:
static auto main() -> void {
auto input = array<string> {"Brachiosaurus", "Amargasaurus", "Mamenchisaurus"};
auto dinosaurs = list<string>(input);
console::write_line("\ncapacity: {0}", dinosaurs.capacity());
for (auto dinosaur : dinosaurs)
console::write_line("\nadd_range(dinosaurs)");
dinosaurs.add_range(dinosaurs);
for(auto dinosaur : dinosaurs)
console::write_line("\nremove_range(2, 2)");
dinosaurs.remove_range(2, 2);
for(auto dinosaur : dinosaurs)
input = {"Tyrannosaurus", "Deinonychus", "Velociraptor"};
console::write_line("\ninsert_range(3, input)");
dinosaurs.insert_range(3, input);
for(auto dinosaur : dinosaurs)
console::write_line("\noutput = dinosaurs.get_range(2, 3).to_array()");
auto output = dinosaurs.get_range(2, 3).to_array();
for (auto dinosaur : output)
}
};
startup_(example::main);
// This code produces the following output :
//
//
// capacity: 3
//
// Brachiosaurus
// Amargasaurus
// Mamenchisaurus
//
// add_range(dinosaurs)
//
// Brachiosaurus
// Amargasaurus
// Mamenchisaurus
// Brachiosaurus
// Amargasaurus
// Mamenchisaurus
//
// remove_range(2, 2)
//
// Brachiosaurus
// Amargasaurus
// Amargasaurus
// Mamenchisaurus
//
// insert_range(3, input)
//
// Brachiosaurus
// Amargasaurus
// Amargasaurus
// Tyrannosaurus
// Deinonychus
// Velociraptor
// Mamenchisaurus
//
// output = dinosaurs.get_range(2, 3).to_array()
//
// Amargasaurus
// Tyrannosaurus
// Deinonychus
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:63
Remarks
The elements are copied onto the xtd::forms::layout::arranged_element_collection <type_t> in the same order they are read by the enumerator of the collection.
This constructor is an O(n) operation, where n is the number of elements in collection.

◆ arranged_element_collection() [4/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( const arranged_element_collection< type_t, sorter_t > & collection)
inline

Default copy constructor with specified list.

Parameters
collectionThe xtd::forms::layout::arranged_element_collection which elements will be inserted from.

◆ arranged_element_collection() [5/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( arranged_element_collection< type_t, sorter_t > && collection)
inline

Move constructor with specified list.

Parameters
listThe xtd::forms::layout::arranged_element_collection which elements will be moved from.

◆ arranged_element_collection() [6/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( const base_type & collection)
inline

Copy constructor with specified base type list.

Parameters
listThe xtd::forms::layout::arranged_element_collection::base_type which elements will be inserted from.

◆ arranged_element_collection() [7/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( base_type && collection)
inline

Move constructor with specified base type list.

Parameters
listThe xtd::forms::layout::arranged_element_collection::base_type which elements will be moved from.

◆ arranged_element_collection() [8/9]

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( std::initializer_list< type_t > items)
inline

Constructs the container with the contents of the specified initializer list, and allocator.

Parameters
itemsThe initializer list to initialize the elements of the container with.

◆ arranged_element_collection() [9/9]

template<class type_t, class sorter_t = sorter_none>
template<std::input_iterator input_iterator_t>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::arranged_element_collection ( input_iterator_t first,
input_iterator_t last )
inline

Constructs the container with the contents of the range [first, last).

Parameters
firstThe first iterator the range to copy the elements from.
lastThe last iterator the range to copy the elements from.
allocThe allocator to use for all memory allocations of this container.

Member Function Documentation

◆ capacity() [1/2]

template<class type_t, class sorter_t = sorter_none>
size_type xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::capacity ( ) const
inlinenoexcept

Gets the total number of elements the internal data structure can hold without resizing.

Returns
Capacity of the currently allocated storage.
Exceptions
xtd::argument_out_of_range_exceptionxtd::collections::generic::list::capacity is set to a value that is less than xtd::collections::generic::list::count.

◆ capacity() [2/2]

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::capacity ( size_type value)
inline

Sets the total number of elements the internal data structure can hold without resizing.

Returns
Capacity of the currently allocated storage.
Exceptions
xtd::out_of_memoryThere is not enough memory available on the system.
xtd::argument_out_of_range_exceptionxtd::collections::generic::list::capacity is set to a value that is less than xtd::collections::generic::list::count.

◆ count()

template<class type_t, class sorter_t = sorter_none>
size_type xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::count ( ) const
inlineoverridenoexcept

Gets the number of elements contained in the xtd::forms::layout::arranged_element_collection <type_t>.

Returns
The number of elements contained in the xtd::forms::layout::arranged_element_collection <type_t>.

◆ data() [1/2]

template<class type_t, class sorter_t = sorter_none>
pointer xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::data ( )
inline

Direct access to the underlying array.

Returns
The underlying array.

◆ data() [2/2]

template<class type_t, class sorter_t = sorter_none>
const_pointer xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::data ( ) const
inline

Direct access to the underlying array.

Returns
The underlying array.

◆ items() [1/2]

template<class type_t, class sorter_t = sorter_none>
const auto & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::items ( ) const
inline

Returns the underlying base type items.

Returns
The underlying base type items.

◆ items() [2/2]

template<class type_t, class sorter_t = sorter_none>
auto & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::items ( )
inline

Returns the underlying base type items.

Returns
The underlying base type items.

◆ sorted() [1/2]

template<class type_t, class sorter_t = sorter_none>
virtual bool xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::sorted ( ) const
inlinevirtualnoexcept

Checks whether the container is sorted.

Returns
true if container is sorted; otherwise false.

◆ sorted() [2/2]

template<class type_t, class sorter_t = sorter_none>
virtual arranged_element_collection & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::sorted ( bool value)
inlinevirtual

Sets the container is sorted.

Parameters
valuetrue if container is sorted; otherwise false.

◆ add() [1/2]

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::add ( const type_t & item)
inlineoverride

Adds an item to the xtd::forms::layout::arranged_element_collection <type_t>.

Parameters
itemThe object to add to the xtd::forms::layout::arranged_element_collection <type_t>.

◆ add() [2/2]

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::add ( type_t && item)
inlinevirtual

Adds an item to the xtd::forms::layout::arranged_element_collection <type_t>.

Parameters
itemThe object to add to the xtd::forms::layout::arranged_element_collection <type_t>.

◆ add_range() [1/5]

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::add_range ( const arranged_element_collection< type_t, sorter_t > & collection)
inlinevirtual

Adds elements to the end.

Parameters
collectionThe elements to add.

◆ add_range() [2/5]

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::add_range ( const std::vector< type_t > & collection)
inlinevirtual

Adds elements to the end.

Parameters
collectionThe elements to add.

◆ add_range() [3/5]

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::add_range ( const std::initializer_list< type_t > & collection)
inlinevirtual

Adds elements to the end.

Parameters
collectionThe elements to add.

◆ add_range() [4/5]

template<class type_t, class sorter_t = sorter_none>
template<class collection_t>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::add_range ( collection_t && collection)
inline

Adds elements to the end.

Parameters
collectionThe elements to add.

◆ add_range() [5/5]

template<class type_t, class sorter_t = sorter_none>
template<class collection_t>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::add_range ( const collection_t & collection)
inline

Adds elements to the end.

Parameters
collectionThe elements to add.

◆ clear()

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::clear ( )
inlineoverride

Removes all items from the xtd::forms::layout::arranged_element_collection <type_t>.

Remarks
xtd::forms::layout::arranged_element_collection::count must be set to 0, and references to other objects from elements of the collection must be released.

◆ contains()

template<class type_t, class sorter_t = sorter_none>
bool xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::contains ( const type_t & item) const
inlineoverridenoexcept

Determines whether the xtd::forms::layout::arranged_element_collection <type_t> contains a specific value.

Parameters
itemThe object to locate in the xtd::forms::layout::arranged_element_collection <type_t>.
Returns
true if item is found in the xtd::forms::layout::arranged_element_collection <type_t>; otherwise, false.

◆ copy_to()

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::copy_to ( xtd::array< type_t > & array,
xtd::size array_index ) const
inlineoverride

Copies the elements of the xtd::forms::layout::arranged_element_collection <type_t> to an xtd::array, starting at a particular xtd::array index.

Parameters
arrayThe one-dimensional xtd::array that is the destination of the elements copied from xtd::forms::layout::arranged_element_collection <type_t>. The xtd::array must have zero-based indexing.
array_indexThe zero-based index in array at which copying begins.
Exceptions
xtd::argument_exceptionThe number of elements in the source xtd::forms::layout::arranged_element_collection <type_t> is greater than the available space from `array_index` to the end of the destination `array`.

◆ get_enumerator()

template<class type_t, class sorter_t = sorter_none>
xtd::collections::generic::enumerator< type_t > xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::get_enumerator ( ) const
inlineoverridenoexcept

Returns an enumerator that iterates through the xtd::forms::layout::arranged_element_collection <type_t>.

Returns
A xtd::collections::generic::.enumerator for the xtd::forms::layout::arranged_element_collection <type_t>.

◆ insert() [1/3]

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::insert ( xtd::size index,
const type_t & value )
inlinevirtual

Inserts specified element at specified index.

Parameters
indexThe index before which the content will be inserted.
valueThe element to insert.

Reimplemented in xtd::forms::control::control_collection.

◆ sort()

template<class type_t, class sorter_t = sorter_none>
virtual arranged_element_collection & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::sort ( )
inlinevirtual

Sorts the content.

◆ remove()

template<class type_t, class sorter_t = sorter_none>
bool xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::remove ( const type_t & item)
inlineoverride

Removes the first occurrence of a specific object from the xtd::forms::layout::arranged_element_collection <type_t>.

Parameters
itemThe object to remove from the xtd::forms::layout::arranged_element_collection <type_t>.
Returns
true if item was successfully removed from the xtd::forms::layout::arranged_element_collection <type_t>; otherwise, false. This method also returns false if item is not found in the original xtd::forms::layout::arranged_element_collection <type_t>.
Remarks
If type typ_t implements the xtd::iequatable <type_t> generic interface, the equality comparer is the xtd::iequatable::equals method of that interface; otherwise, the default equality comparer is xtd::object::equals.
This method performs a linear search; therefore, this method is an O(n) operation, where n is xtd::forms::layout::arranged_element_collection::count.

◆ remove_at()

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::remove_at ( size_t index)
inlinevirtual

Erases element at specified index.

Parameters
posThe index which the content will be erased.

◆ to_array()

template<class type_t, class sorter_t = sorter_none>
xtd::array< type_t > xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::to_array ( ) const
inlinenoexcept

Gets an array with the elements of the container.

Returns
The array that contains elements of the container.

◆ operator=() [1/3]

template<class type_t, class sorter_t = sorter_none>
arranged_element_collection & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::operator= ( const arranged_element_collection< type_t, sorter_t > & other)
inline

Copy assignment operator. Replaces the contents with a copy of the contents of other.

Parameters
otherAnother container to use as data source.
Returns
This current instance.

◆ operator=() [2/3]

template<class type_t, class sorter_t = sorter_none>
arranged_element_collection & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::operator= ( arranged_element_collection< type_t, sorter_t > && other)
inlinenoexcept

Move assignment operator. Replaces the contents with those of other using move semantics (i.e. the data in other is moved from other into this container). other is in a valid but unspecified state afterwards.

Parameters
otherAnother base type container to use as data source.
Returns
This current instance.

◆ operator=() [3/3]

template<class type_t, class sorter_t = sorter_none>
arranged_element_collection & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::operator= ( const std::initializer_list< type_t > & items)
inline

Replaces the contents with those identified by initializer list ilist.

Parameters
itemsInitializer list to use as data source
Returns
This current instance.

◆ operator[]() [1/2]

template<class type_t, class sorter_t = sorter_none>
value_type & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::operator[] ( size_type index)
inline

Access specified element.

Parameters
indexThe position of the element to return.
Returns
The requested element.

◆ operator[]() [2/2]

template<class type_t, class sorter_t = sorter_none>
const value_type & xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::operator[] ( size_type index) const
inline

Access specified element.

Parameters
indexThe position of the element to return.
Returns
The requested element.

◆ operator const_base_type &()

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::operator const_base_type & ( ) const
inlinenoexcept

Returns a reference to the underlying base type.

Returns
Reference to the underlying base type.

◆ operator base_type &()

template<class type_t, class sorter_t = sorter_none>
xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::operator base_type & ( )
inlinenoexcept

Returns a reference to the underlying base type.

Returns
Reference to the underlying base type.

◆ max_size()

template<class type_t, class sorter_t = sorter_none>
size_type xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::max_size ( ) const
inlinenoexcept

Returns the maximum possible number of elements.

Returns
The maximum possible number of elements.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::max_size().empty - Will be removed in version 0.4.0.

◆ at() [1/2]

template<class type_t, class sorter_t = sorter_none>
reference xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::at ( size_type pos)
inline

Access specified element with bounds checking.

Parameters
posThe position of the element to return.
Exceptions
std::out_of_rangepos is greater than arranged_element_collection::size.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::rator [] - Will be removed in version 0.4.0.

◆ at() [2/2]

template<class type_t, class sorter_t = sorter_none>
const_reference xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::at ( size_type pos) const
inline

Access specified element with bounds checking.

Parameters
posThe position of the element to return.
Exceptions
std::out_of_rangepos is greater than arranged_element_collection::size.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::rator [] - Will be removed in version 0.4.0.

◆ back() [1/2]

template<class type_t, class sorter_t = sorter_none>
reference xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::back ( )
inline

Access the last element.

Returns
The last element.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::operator [~1_z] - Will be removed in version 0.4.0.

◆ back() [2/2]

template<class type_t, class sorter_t = sorter_none>
const_reference xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::back ( ) const
inline

Access the last element.

Returns
The last element.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::operator [~1_z] - Will be removed in version 0.4.0.

◆ crbegin()

template<class type_t, class sorter_t = sorter_none>
const_reverse_iterator xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::crbegin ( ) const
inlinenoexcept

Returns a reverse iterator to the end.

Returns
The reverse iterator to the end.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().crbegin - Will be removed in version 0.4.0.

◆ crend()

template<class type_t, class sorter_t = sorter_none>
const_reverse_iterator xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::crend ( ) const
inlinenoexcept

Returns a reverse iterator to the end.

Returns
The reverse iterator to the end.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().crend - Will be removed in version 0.4.0.

◆ front() [1/2]

template<class type_t, class sorter_t = sorter_none>
reference xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::front ( )
inline

Access the first element.

Returns
The first element.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::operator [0] - Will be removed in version 0.4.0.

◆ front() [2/2]

template<class type_t, class sorter_t = sorter_none>
const_reference xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::front ( ) const
inline

Access the first element.

Returns
The first element.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::operator [0] - Will be removed in version 0.4.0.

◆ get_allocator()

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::get_allocator ( ) const
inlinenoexcept

Returns the associated allocator.

Returns
The associate allocator.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::count - Will be removed in version 0.4.0.

◆ emplace()

template<class type_t, class sorter_t = sorter_none>
template<class ... args_t>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::emplace ( xtd::collections::generic::list< value_type >::const_iterator pos,
args_t &&... args )
inline

Inserts specified element at specified position.

Parameters
posThe iterator before which the content will be inserted. pos may be the arranged_element_collection::end iterator.
argsThe arguments to forward to the constructor of the element
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::insert - Will be removed in version 0.4.0.

◆ emplace_back()

template<class type_t, class sorter_t = sorter_none>
template<class ... args_t>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::emplace_back ( args_t &&... args)
inline

Adds an element to the end.

Parameters
argsThe arguments to forward to the constructor of the element
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add - Will be removed in version 0.4.0.

◆ erase() [1/4]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::erase ( xtd::collections::generic::list< value_type >::iterator pos)
inline

Erases element at specified position.

Parameters
posThe iterator which the content will be erased.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::remove_at - Will be removed in version 0.4.0.

◆ erase() [2/4]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::erase ( xtd::collections::generic::list< value_type >::const_iterator pos)
inline

Erases element at specified position.

Parameters
posThe iterator which the content will be erased.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::remove_at - Will be removed in version 0.4.0.

◆ erase() [3/4]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::erase ( xtd::collections::generic::list< value_type >::iterator first,
xtd::collections::generic::list< value_type >::iterator last )
inline

Erases elements at specified range.

Parameters
firstThe first iterator range which the content will be erased.
firstThe last iterator range which the content will be erased.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::remove_at - Will be removed in version 0.4.0.

◆ erase() [4/4]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::erase ( xtd::collections::generic::list< value_type >::const_iterator first,
xtd::collections::generic::list< value_type >::const_iterator last )
inline

Erases elements at specified range.

Parameters
firstThe first iterator range which the content will be erased.
firstThe last iterator range which the content will be erased.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::remove_at - Will be removed in version 0.4.0.

◆ erase_at()

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::erase_at ( size_t index)
inline

Erases element at specified index.

Parameters
posThe index which the content will be erased.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::remove_at - Will be removed in version 0.4.0.

◆ insert() [2/3]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::insert ( xtd::collections::generic::list< value_type >::const_iterator pos,
const type_t & value )
inline

Inserts specified element at specified position.

Parameters
posThe iterator before which the content will be inserted. pos may be the arranged_element_collection::end iterator.
valueThe element to insert.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::insert - Will be removed in version 0.4.0.

◆ insert() [3/3]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::insert ( xtd::collections::generic::list< value_type >::const_iterator pos,
type_t && value )
inline

Inserts specified element at specified position.

Parameters
posThe iterator before which the content will be inserted. pos may be the arranged_element_collection::end iterator.
valueThe element to insert.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::insert - Will be removed in version 0.4.0.

◆ insert_at()

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::insert_at ( size_t index,
const type_t & value )
inline

Inserts specified element at specified index.

Parameters
indexThe index before which the content will be inserted.
valueThe element to insert.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::insert - Will be removed in version 0.4.0.

◆ pop_back()

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::pop_back ( )
inline

Removes the last element of the container.

Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::remove(count() - 1) - Will be removed in version 0.4.0.

◆ push_back() [1/2]

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::push_back ( const type_t & item)
inline

Adds an element to the end.

Parameters
itemThe element to add.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add - Will be removed in version 0.4.0.

◆ push_back() [2/2]

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::push_back ( type_t && item)
inline

Adds an element to the end.

Parameters
itemThe element to add.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add - Will be removed in version 0.4.0.

◆ push_back_range() [1/5]

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::push_back_range ( const arranged_element_collection< type_t, sorter_t > & collection)
inline

Adds elements to the end.

Parameters
collectionThe elements to add.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add_range - Will be removed in version 0.4.0.

◆ push_back_range() [2/5]

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::push_back_range ( const std::vector< type_t > & collection)
inline

Adds elements to the end.

Parameters
collectionThe elements to add.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add_range - Will be removed in version 0.4.0.

◆ push_back_range() [3/5]

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::push_back_range ( const std::initializer_list< type_t > & collection)
inline

Adds elements to the end.

Parameters
collectionThe elements to add.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add_range - Will be removed in version 0.4.0.

◆ push_back_range() [4/5]

template<class type_t, class sorter_t = sorter_none>
template<class collection_t>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::push_back_range ( collection_t && collection)
inline

Adds elements to the end.

Parameters
collectionThe elements to add.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add_range - Will be removed in version 0.4.0.

◆ push_back_range() [5/5]

template<class type_t, class sorter_t = sorter_none>
template<class iterator_t>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::push_back_range ( iterator_t begin,
iterator_t end )
inline

Adds elements to the end.

Parameters
collectionThe elements to add.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::add_range - Will be removed in version 0.4.0.

◆ to_vector()

template<class type_t, class sorter_t = sorter_none>
std::vector< type_t > xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::to_vector ( ) const
inlinenoexcept

Gets an array with the elements of the container.

Returns
The array that contains elements of the container.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::to_array - Will be removed in version 0.4.0.

◆ rbegin() [1/2]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::rbegin ( )
inlinenoexcept

Returns a reverse iterator to the end.

Returns
The reverse iterator to the end.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().rbegin - Will be removed in version 0.4.0.

◆ rbegin() [2/2]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::rbegin ( ) const
inlinenoexcept

Returns a reverse iterator to the end.

Returns
The reverse iterator to the end.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().rbegin - Will be removed in version 0.4.0.

◆ rend() [1/2]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::rend ( )
inlinenoexcept

Returns a reverse iterator to the end.

Returns
The reverse iterator to the end.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().rend - Will be removed in version 0.4.0.

◆ rend() [2/2]

template<class type_t, class sorter_t = sorter_none>
auto xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::rend ( ) const
inlinenoexcept

Returns a reverse iterator to the end.

Returns
The reverse iterator to the end.
Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().rend - Will be removed in version 0.4.0.

◆ reserve()

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::reserve ( size_type size)
inline

Reserves storage.

Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().reserve - Will be removed in version 0.4.0.

◆ shrink_to_fit()

template<class type_t, class sorter_t = sorter_none>
void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::shrink_to_fit ( )
inline

Reduces memory usage by freeing unused memory.

Deprecated
Replaced by xtd::forms::layout::arranged_element_collection::items().shrink_to_fit - Will be removed in version 0.4.0.

◆ on_item_added()

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::on_item_added ( size_t index,
type_t & item )
inlineprotectedvirtual

Raises the xtd::forms::layout::arranged_element_collection::item_added event.

Parameters
indexThe index of the item.
itemThe item added.

◆ on_item_updated()

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::on_item_updated ( size_t index,
type_t & item )
inlineprotectedvirtual

Raises the xtd::forms::layout::arranged_element_collection::item_updated event.

Parameters
indexThe index of the item.
itemThe item updated.

◆ on_item_removed()

template<class type_t, class sorter_t = sorter_none>
virtual void xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::on_item_removed ( size_t index,
type_t & item )
inlineprotectedvirtual

Raises the xtd::forms::layout::arranged_element_collection::item_removed event.

Parameters
indexThe index of the item.
itemThe item removed.

Reimplemented in xtd::forms::control::control_collection.

Member Data Documentation

◆ npos

template<class type_t, class sorter_t = sorter_none>
xtd::size xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::npos
inlinestaticconstexpr

Represents a value that is not a valid position in a collection.

Remarks
This constant is typically used to indicate the absence of an index or a failed search operation. It is equivalent to the maximum value of xtd::size.
Examples
auto controls = control_collection {label1, button1, choice1};
if (items.index_of(label1) == items.npos)
console::write_line("Value not found");
const auto & items() const
Returns the underlying base type items.
Definition arranged_element_collection.hpp:244
@ button1
The first button on the message box is the default button.
Definition message_dialog_default_button.hpp:24

◆ bpos

template<class type_t, class sorter_t = sorter_none>
xtd::size xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::bpos
inlinestaticconstexpr

Represents the index of the first valid element in a collection.

Remarks
Unlike xtd::npos (which means "no position"), xtd::bpos points to the first accessible element of a collection. It is equivalent to 0.
Examples
auto controls = control_collection {label1, button1, choice1};
controls[bpos].width(240); // change the with of label1 to 240
controls[bpos + 1].width(120); // change the with of button1 to 120
constexpr xtd::size bpos
Represents the index of the firsy valid element in a collection.
Definition bpos.hpp:25

◆ epos

template<class type_t, class sorter_t = sorter_none>
xtd::size xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::epos
inlinestaticconstexpr

Represents the index of the last valid element in a collection.

Remarks
Unlike xtd::npos (which means "no position"), xtd::epos points to the last accessible element of a collection. It is equivalent to items.count() - 1.
Note
This constant is provided for readability and convenience. For example, items[xtd::epos] directly accesses the last element without manually subtracting one from the collection count.
Remarks
The epos is equivalent to ~1_z. With bitwise operator the code is more concise.
Examples
auto controls = control_collection {label1, button1, choice1};
controls[epos].width(240); // change the with of choice1 to 240
controls[epos - 1].width(120); // change the with of button1 to 120
constexpr xtd::size epos
Represents the index of the last valid element in a collection.
Definition epos.hpp:33
The wollowing exemple shows the same example with bitwise operator as index.
auto controls = control_collection {label1, button1, choice1};
controls[~1_z].width(240); // change the with of choice1 to 240
controls[~2_z].width(120); // change the with of button1 to 120

◆ item_added

template<class type_t, class sorter_t = sorter_none>
event<arranged_element_collection, delegate<void(size_t, type_t& item)> > xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::item_added

Occurs when an item is added to the collection.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ item_updated

template<class type_t, class sorter_t = sorter_none>
event<arranged_element_collection, delegate<void(size_t, type_t& item)> > xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::item_updated

Occurs when an item is updated in the collection.

Remarks
For more information about handling events, see Handling and Raising Events.

◆ item_removed

template<class type_t, class sorter_t = sorter_none>
event<arranged_element_collection, delegate<void(size_t, type_t& item)> > xtd::forms::layout::arranged_element_collection< type_t, sorter_t >::item_removed

Occurs when an item is removed from the collection.

Remarks
For more information about handling events, see Handling and Raising Events.

The documentation for this class was generated from the following file: