7#include <xtd/argument_out_of_range_exception>
8#include <xtd/event_args>
9#include <xtd/event_handler>
12#include <xtd/size_object>
31 template<
typename type_t,
typename sorter_t = sorter_none>
41 template <
typename ...args_t>
42 value_type(args_t&& ...args) : type_t(args...) {}
44 if (value.owner) owner = value.owner;
45 if (owner !=
nullptr && !owner->inserting_ && !owner->erasing_) owner->
on_item_updated(pos,
static_cast<type_t&
>(
const_cast<value_type&
>(value)));
46 type_t::operator =(value);
50 if (value.owner) owner = value.owner;
51 if (owner !=
nullptr && !owner->inserting_ && !owner->erasing_) owner->
on_item_updated(pos,
static_cast<type_t&
>(value));
52 type_t::operator =(value);
55 operator type_t() {
return *
this;}
56 friend std::ostream& operator <<(std::ostream& os,
const value_type& value) {
return os << static_cast<const type_t&>(value);}
79 using pointer =
typename std::allocator_traits<allocator_type>::pointer;
81 using const_pointer =
typename std::allocator_traits<allocator_type>::const_pointer;
83 using iterator =
typename std::vector<value_type>::iterator;
116 for (
auto item : collection)
119 arranged_element_collection(
const arranged_element_collection& collection) {
push_back_range(collection);}
120 arranged_element_collection& operator =(
const arranged_element_collection& collection) {
125 arranged_element_collection(arranged_element_collection&&) =
default;
126 bool operator ==(
const arranged_element_collection& value)
const {
return collection_ == value.collection_;}
127 bool operator !=(
const arranged_element_collection& value)
const {
return !operator ==(value);}
141 collection_[pos].pos = pos;
142 collection_[pos].owner =
this;
143 return collection_.at(pos);
213 bool empty() const noexcept {
return collection_.empty();}
235 virtual bool sorted() const noexcept {
return sorted_;}
239 if (sorted_ != value) {
256 size_t index = pos -
begin();
258 iterator result = collection_.insert(pos, value);
260 (*this)[index].owner =
this;
261 (*this)[index].pos = index;
270 size_t index = pos -
begin();
272 iterator result = collection_.insert(pos, value);
274 (*this)[index].owner =
this;
275 (*this)[index].pos = index;
292 template<
typename ...args_t>
294 size_t index = pos -
begin();
296 iterator result = collection_.insert(pos, args...);
298 (*this)[index].owner =
this;
299 (*this)[index].pos = index;
307 template<
typename ...args_t>
309 collection_.push_back(args...);
310 size_t index = collection_.size() - 1;
311 (*this)[index].owner =
this;
312 (*this)[index].pos = index;
322 iterator result = collection_.erase(pos);
331 iterator result = collection_.erase(pos);
341 for (
iterator it = first; it <= last; ++it)
370 collection_.push_back(item);
371 size_t index = collection_.size() - 1;
372 (*this)[index].owner =
this;
373 (*this)[index].pos = index;
380 collection_.push_back(item);
381 size_t index = collection_.size() - 1;
382 (*this)[index].owner =
this;
383 (*this)[index].pos = index;
408 template<
typename collection_t>
410 for (
auto& item : collection)
415 template<
typename iterator_t>
417 for (
auto it =
begin; it !=
end; ++it)
430 std::vector<type_t> array;
431 std::for_each(collection_.begin(), collection_.end(), [&](
auto item) {array.push_back(item);});
446 collection_[pos].pos = pos;
447 collection_[pos].owner =
this;
448 return collection_[pos];
453 collection_[pos].pos = pos;
455 return collection_[pos];
501 mutable std::vector<value_type, allocator_type> collection_;
502 bool inserting_ =
false;
503 bool erasing_ =
false;
504 bool sorted_ =
false;
The exception that is thrown when one of the arguments provided to a method is out of range.
Definition argument_out_of_range_exception.h:20
static constexpr type_t max_value
Represents the largest possible value of type_t. This field is constant.
Definition box_integer.h:65
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:32
#define csf_
Provides information about the current stack frame.
Definition current_stack_frame.h:30
size_t size
Represents a size of any object in bytes.
Definition types.h:197
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::forms::layout::sorter_none class.