14#include <AUI/Common/AObject.h>
16#include <AUI/Traits/concepts.h>
20namespace aui::detail {
21 template<aui::convertible_to<_<AView>> Storage = _<AView>>
22 class LinearLayoutImpl:
public ALayout {
24 void removeView(aui::no_escape<AView> view,
size_t index)
override {
25 if constexpr (std::is_same_v<Storage, _<AView>>) {
28 mViews.removeAt(index);
31 AVector<_<AView>> getAllViews()
override {
32 return { mViews.begin(), mViews.end() };
36 void addViewBasicImpl(Storage view, AOptional<size_t> index) {
37 auto at = mViews.end();
39 at = mViews.begin() + *index;
41 mViews.insert(at, std::move(view));
45 AVector<Storage> mViews;
58template<aui::convertible_to<_<AView>> Storage = _<AView>>
65 addViewBasicImpl(view, index);
Implements addView/removeView/getAllViews and protected mViews field for Vertical,...
Definition ALinearLayout.h:59
void addView(const _< AView > &view, AOptional< size_t > index) override
Attaches view to the layout.
Definition ALinearLayout.h:64
Utility wrapper implementing the stack-allocated (fast) optional idiom.
Definition AOptional.h:32
Base class of all UI objects.
Definition AView.h:78
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
#define AUI_ASSERT(condition)
Asserts that the passed condition evaluates to true.
Definition Assert.h:55