14 #include <type_traits>
46 for (
auto& event : other.attachedEvents_)
48 for (
auto& event : other.attachedOneshotEvents_)
55 for (
auto& event : other.attachedEvents_)
57 for (
auto& event : other.attachedOneshotEvents_)
99 virtual void update(
bool =
false)
const
106 if (activationResult.found ==
false)
131 template <
typename ContainedT>
142 : observed_{observed}
146 : observed_{observed}
175 operator ContainedT&()
222 template <
typename T = ContainedT>
233 template <
typename T = ContainedT>
245 template <
typename T = ContainedT>
253 template <
typename T = ContainedT,
typename U>
260 template <
typename T = ContainedT,
typename U>
268 template <
typename T = ContainedT>
269 requires std::equality_comparable_with<ContainedT, T> && Fundamental<T> && Fundamental<ContainedT>
275 template <
typename T = ContainedT>
276 requires std::equality_comparable_with<ContainedT, T>
303 explicit operator bool() const
304 requires std::convertible_to<ContainedT,
bool>
346 template <
typename ContainerT>
349 namespace ContainerWrapUtility
351 template <
typename T,
typename ContainerT>
366 other.owner_ =
nullptr;
368 other.ref_ =
nullptr;
378 other.owner_ =
nullptr;
380 other.ref_ =
nullptr;
432 template <
typename T,
typename ContainerT>
435 return wrapper.
get();
437 template <
typename T,
typename ContainerT>
440 return wrapper.
get();
451 template <
typename T,
typename ContainerT>
503 template <
typename WrappedIterator,
typename ContainerT>
560 return it_ - other.it_;
564 if constexpr (std::is_same_v<WrappedIterator, typename ContainerT::reverse_iterator>)
567 owner_->contained_.size() -
static_cast<std::size_t
>(1) -
568 static_cast<std::size_t
>(it_ - owner_->contained_.rbegin()),
572 owner_,
static_cast<std::size_t
>(it_ - owner_->contained_.begin()), *it_};
580 if constexpr (std::is_same_v<WrappedIterator, typename ContainerT::reverse_iterator>)
583 owner_->contained_.size() -
static_cast<std::size_t
>(1) -
584 static_cast<std::size_t
>(it_ - owner_->contained_.rbegin()),
588 owner_,
static_cast<std::size_t
>(it_ - owner_->contained_.begin()), &*it_};
600 return it_ < other.it_;
604 return it_ > other.it_;
608 return it_ <= other.it_;
612 return it_ >= other.it_;
616 return it_ == other.it_;
629 template <
typename ContainerT>
664 template <
typename T = ContainerT>
670 template <
typename T = ContainerT>
686 template <
typename T = ContainerT>
692 template <
typename T = ContainerT>
709 constexpr
auto map(
auto&&
function)
const;
710 constexpr
auto map(
auto&&
function);
712 template <
typename T = ContainerT>
726 template <
typename Iterator>
727 void assign(Iterator first, Iterator last)
733 void assign(std::initializer_list<value_type> ilist)
837 std::size_t
size() const noexcept
841 template <
typename U = ContainerT>
846 template <
typename U = ContainerT>
852 template <
typename U = ContainerT>
857 template <
typename U = ContainerT>
870 template <
typename U = ContainerT>
872 std::pair<typename ContainerT::iterator, bool>,
873 decltype(std::declval<U>().
insert(std::declval<const value_type&>()))>
884 template <
typename U = ContainerT>
886 std::pair<typename ContainerT::iterator, bool>,
887 decltype(std::declval<U>().
insert(std::declval<value_type&&>()))>
904 const auto distance = pos -
cbegin();
915 const auto distance = pos -
cbegin();
926 const auto distance = pos -
cbegin();
931 template <
typename Iterator>
936 template <
typename Iterator>
939 const auto distance = pos -
cbegin();
940 auto it =
contained_.insert(pos, first, last);
950 const auto distance = pos -
cbegin();
955 template <
typename... Args>
958 const auto distance = pos -
cbegin();
959 auto it =
contained_.emplace(pos, std::forward<Args>(args)...);
965 const auto distance = pos -
begin();
973 const auto distance = pos -
cbegin();
981 const auto distance = first -
begin();
982 const auto distance2 = std::distance(first, last);
990 const auto distance = first -
cbegin();
991 const auto distance2 = std::distance(first, last);
997 template <
typename U = ContainerT>
1004 template <
typename U = ContainerT>
1011 template <
typename U = ContainerT>
1018 template <
typename U = ContainerT>
1025 template <
typename... Args>
1028 contained_.emplace_back(std::forward<Args>(args)...);
1031 template <
typename U = ContainerT,
typename... Args>
1034 contained_.emplace_front(std::forward<Args>(args)...);
1045 template <
typename U = ContainerT>
1054 template <
typename U = ContainerT>
1059 if (sizeBefore < count && sizeBefore != 0)
1064 if (sizeBefore < count)
1068 else if (sizeBefore != 0)
1073 template <
typename U = ContainerT>
1076 decltype(std::declval<U>().
resize(std::declval<std::size_t>(), std::declval<value_type const&>()))>
1082 if (sizeBefore < count)
1086 else if (sizeBefore != 0)
1117 void update(
bool force =
false)
const override
1128 std::function<void(
int)> doInsert;
1129 doInsert = [&](
int retries) {
1132 const auto result =
rangeContext_->insertModificationRange(low, high, type);
1144 doInsert(retries + 1);
1175 if (
auto shared = weak.lock(); shared)
1186 const bool fixupPerformed =
rangeContext_->eraseNotify(index, high);
1200 template <
typename T>
1219 template <
typename... Parameters>
1226 static constexpr
auto isRandomAccess =
true;
1239 template <
typename... Parameters>
1246 static constexpr
auto isRandomAccess =
true;
1259 template <
typename... Parameters>
1266 static constexpr
auto isRandomAccess =
true;
1268 Observed<std::basic_string<Parameters...>>&
operator=(std::basic_string<Parameters...>
const& contained)
1275 ObservedContainer<std::basic_string<Parameters...>>::operator=(std::move(contained));
1279 Observed<std::basic_string<Parameters...>>&
erase(std::size_t index = 0, std::size_t count = std::string::npos)
1281 if (count == std::size_t{0})
1283 const auto sizeBefore = this->
contained_.size();
1284 const auto high = count == std::string::npos ? sizeBefore - 1 : count - 1;
1285 this->eraseNotify(index, high);
1291 template <
typename... Parameters>
1298 static constexpr
auto isRandomAccess =
false;
1304 template <
typename T = std::set<Parameters...>>
1320 template <
typename... Parameters>
1327 static constexpr
auto isRandomAccess =
false;
1333 template <
typename T = std::list<Parameters...>>
1355 using ObservedBase::operator=;
1370 template <
typename T>
1373 static constexpr
bool value =
false;
1376 template <
typename T>
1379 static constexpr
bool value =
true;
1382 template <
typename T>
1385 static constexpr
bool value =
false;
1388 template <
typename T>
1391 static constexpr
bool value =
true;
1394 template <
typename T>
1397 static constexpr
bool value =
false;
1400 template <
typename T>
1403 static constexpr
bool value =
true;
1406 template <
typename T>
1409 static constexpr
bool value =
1414 template <
typename T>
1418 ++observedValue.
value();
1420 return observedValue;
1422 template <
typename T>
1426 auto tmp = observedValue.
value();
1427 ++observedValue.
value();
1432 template <
typename T>
1436 --observedValue.
value();
1437 observedValue.update();
1438 return observedValue;
1440 template <
typename T>
1444 auto tmp = observedValue.value();
1445 --observedValue.value();
1446 observedValue.update();
1450 template <
typename T>
1452 template <
typename T>
1454 template <
typename T>
1456 template <
typename T>
1461 template <
typename T>
1466 : observed_{&observed}
1471 return observed_->value();
1476 observed_->attachEvent(eventId);
1481 observed_->detachEvent(eventId);
1488 template <
typename T>
1498 template <
typename T>
1501 using type = std::weak_ptr<Observed<T>>;
1503 template <
typename T>
1506 using type = std::weak_ptr<Observed<T>>;
1508 template <
typename T>
1511 using type = std::weak_ptr<const Observed<T>>;
1513 template <
typename T>
1516 using type = std::weak_ptr<const Observed<T>>;
1519 template <
typename T>
1531 template <
typename T>
1534 using type = std::weak_ptr<Observed<T>>;
1537 template <
typename T>
1540 using type = std::weak_ptr<Observed<T>>;
1544 template <
typename T>
1546 template <
typename T>
1548 template <
typename T>
1552 template <
typename T>
1557 template <
typename T>
1562 template <
typename T>
1567 template <
typename T>
1572 template <
typename T>
1577 template <
typename T>
1582 template <
typename T>
#define NUI_ASSERT(condition, message)
Definition: assert.hpp:31
Definition: observed_value.hpp:505
auto operator->() const
Definition: observed_value.hpp:590
IteratorWrapper operator++(int)
Definition: observed_value.hpp:537
std::random_access_iterator_tag iterator_category
Definition: observed_value.hpp:507
auto operator*()
Definition: observed_value.hpp:562
IteratorWrapper(ObservedContainer< ContainerT > *owner, WrappedIterator it)
Definition: observed_value.hpp:514
friend IteratorWrapper operator-(IteratorWrapper const &wrap, difference_type n)
Definition: observed_value.hpp:554
IteratorWrapper operator[](std::size_t offset) const
Definition: observed_value.hpp:594
IteratorWrapper & operator-=(difference_type n)
Definition: observed_value.hpp:527
auto operator->()
Definition: observed_value.hpp:578
typename WrappedIterator::value_type value_type
Definition: observed_value.hpp:508
WrappedIterator getWrapped() const
Definition: observed_value.hpp:618
bool operator<(IteratorWrapper const &other) const
Definition: observed_value.hpp:598
IteratorWrapper(IteratorWrapper const &)=default
IteratorWrapper & operator+=(difference_type n)
Definition: observed_value.hpp:522
bool operator>=(IteratorWrapper const &other) const
Definition: observed_value.hpp:610
IteratorWrapper & operator=(IteratorWrapper const &)=default
difference_type operator-(IteratorWrapper const &other) const
Definition: observed_value.hpp:558
IteratorWrapper operator--(int)
Definition: observed_value.hpp:546
friend IteratorWrapper operator+(IteratorWrapper const &wrap, difference_type n)
Definition: observed_value.hpp:550
IteratorWrapper & operator++()
Definition: observed_value.hpp:532
IteratorWrapper(IteratorWrapper &&)=default
bool operator==(IteratorWrapper const &other) const
Definition: observed_value.hpp:614
bool operator>(IteratorWrapper const &other) const
Definition: observed_value.hpp:602
auto operator*() const
Definition: observed_value.hpp:574
bool operator<=(IteratorWrapper const &other) const
Definition: observed_value.hpp:606
typename WrappedIterator::difference_type difference_type
Definition: observed_value.hpp:509
IteratorWrapper & operator--()
Definition: observed_value.hpp:541
IteratorWrapper & operator=(IteratorWrapper &&)=default
Definition: observed_value.hpp:453
T & operator*()
Definition: observed_value.hpp:464
void operator=(T *ptr)
Definition: observed_value.hpp:491
T const & operator*() const
Definition: observed_value.hpp:469
ObservedContainer< ContainerT > * owner_
Definition: observed_value.hpp:498
T * operator->()
Definition: observed_value.hpp:473
std::size_t pos_
Definition: observed_value.hpp:499
T * ptr_
Definition: observed_value.hpp:500
T const & getReadonly()
Definition: observed_value.hpp:487
T const * operator->() const
Definition: observed_value.hpp:478
T & get()
Definition: observed_value.hpp:482
PointerWrapper(ObservedContainer< ContainerT > *owner, std::size_t pos, T *ptr) noexcept
Definition: observed_value.hpp:455
Definition: observed_value.hpp:353
T const & operator*() const
Definition: observed_value.hpp:393
T const & getReadonly()
Definition: observed_value.hpp:411
T * ref_
Definition: observed_value.hpp:429
std::size_t pos_
Definition: observed_value.hpp:428
T & get()
Definition: observed_value.hpp:406
void operator=(T const &val)
Definition: observed_value.hpp:420
ReferenceWrapper(ReferenceWrapper &&other) noexcept
Definition: observed_value.hpp:361
T * operator->()
Definition: observed_value.hpp:397
ReferenceWrapper(ReferenceWrapper const &)=default
T const * operator->() const
Definition: observed_value.hpp:402
ReferenceWrapper & operator=(ReferenceWrapper const &)=default
T & operator*()
Definition: observed_value.hpp:388
void operator=(T &&val)
Definition: observed_value.hpp:415
ObservedContainer< ContainerT > * owner_
Definition: observed_value.hpp:427
ReferenceWrapper(ObservedContainer< ContainerT > *owner, std::size_t pos, T &ref)
Definition: observed_value.hpp:355
ReferenceWrapper & operator=(ReferenceWrapper &&other) noexcept
Definition: observed_value.hpp:371
This object can be copied with low cost.
Definition: event_context.hpp:38
void removeAfterEffect(EventIdType id)
Definition: event_context.hpp:80
EventIdType registerAfterEffect(Event event)
Definition: event_context.hpp:72
auto activateEvent(EventIdType id)
Definition: event_context.hpp:56
auto activateAfterEffect(EventIdType id)
Definition: event_context.hpp:60
EventRegistry::EventIdType EventIdType
Definition: event_context.hpp:40
void executeActiveEventsImmediately()
Definition: event_context.hpp:64
constexpr static EventIdType invalidEventId
Definition: event_registry.hpp:18
Definition: observed_value.hpp:139
auto & operator*()
Definition: observed_value.hpp:171
auto * operator->()
Definition: observed_value.hpp:167
ModificationProxy(ModifiableObserved &observed)
Definition: observed_value.hpp:141
ModificationProxy(ModifiableObserved &observed, bool now)
Definition: observed_value.hpp:145
~ModificationProxy()
Definition: observed_value.hpp:149
auto & value()
Definition: observed_value.hpp:163
Definition: observed_value.hpp:133
ModifiableObserved(T &&t)
Definition: observed_value.hpp:223
void assignWithoutUpdate(ContainedT &&t)
Sets the value without making an update.
Definition: observed_value.hpp:337
ModificationProxy modify()
Can be used to make mutations to the underlying class that get commited when the returned proxy is de...
Definition: observed_value.hpp:293
requires std::equality_comparable_with< ContainedT, T > &&Fundamental< T > &&Fundamental< ContainedT > ModifiableObserved & operator=(T &&t)
Definition: observed_value.hpp:270
ModifiableObserved(CustomEventContextFlag_t, EventContext *ctx)
Definition: observed_value.hpp:228
requires PlusAssignable< T, U > ModifiableObserved< T > & operator+=(U const &rhs)
Definition: observed_value.hpp:255
ContainedT const * operator->() const
Definition: observed_value.hpp:329
ContainedT & operator*()
Definition: observed_value.hpp:317
ModifiableObserved(ModifiableObserved &&other)
Definition: observed_value.hpp:191
requires MinusAssignable< T, U > ModifiableObserved< T > & operator-=(U const &rhs)
Definition: observed_value.hpp:262
ModifiableObserved()
Definition: observed_value.hpp:186
ModificationProxy modifyNow()
Definition: observed_value.hpp:298
ModifiableObserved & operator=(ModifiableObserved &&other)
Definition: observed_value.hpp:198
ContainedT value_type
Definition: observed_value.hpp:135
ModifiableObserved & operator=(ContainedT const &contained)
Definition: observed_value.hpp:208
~ModifiableObserved()=default
requires std::equality_comparable_with< ContainedT, T > ModifiableObserved & assignChecked(T &&other)
Definition: observed_value.hpp:277
ModifiableObserved(const ModifiableObserved &)=delete
ContainedT const & value() const
Definition: observed_value.hpp:313
ContainedT contained_
Definition: observed_value.hpp:343
ModifiableObserved & operator=(ContainedT &&contained)
Definition: observed_value.hpp:214
ModifiableObserved & operator=(T &&t)
Assign a completely new value.
Definition: observed_value.hpp:246
ModifiableObserved(CustomEventContextFlag_t, EventContext *ctx, T &&t)
Definition: observed_value.hpp:234
ModifiableObserved & operator=(const ModifiableObserved &)=delete
ContainedT * operator->()
Definition: observed_value.hpp:325
ContainedT const & operator*() const
Definition: observed_value.hpp:321
Utility class to detect if an object was moved.
Definition: move_detector.hpp:9
bool wasMoved() const noexcept
Definition: move_detector.hpp:24
Definition: observed_value.hpp:30
std::size_t totalAttachedEventCount() const
Definition: observed_value.hpp:85
void attachOneshotEvent(EventContext::EventIdType eventId) const
Definition: observed_value.hpp:66
std::size_t attachedOneshotEventCount() const
Definition: observed_value.hpp:81
void detachAllEvents()
You should never need to do this.
Definition: observed_value.hpp:93
virtual void update(bool=false) const
Definition: observed_value.hpp:99
ObservedBase & operator=(ObservedBase const &)=delete
ObservedBase(CustomEventContextFlag_t, EventContext *ctx)
Definition: observed_value.hpp:32
std::size_t attachedEventCount() const
Definition: observed_value.hpp:77
ObservedBase(ObservedBase const &)=delete
void attachEvent(EventContext::EventIdType eventId) const
Definition: observed_value.hpp:62
ObservedBase & operator=(ObservedBase &&other)
Definition: observed_value.hpp:52
void detachEvent(EventContext::EventIdType eventId) const
Definition: observed_value.hpp:70
ObservedBase(ObservedBase &&other)
Definition: observed_value.hpp:39
void updateNow(bool force=false) const
Definition: observed_value.hpp:117
virtual ~ObservedBase()=default
EventContext * eventContext_
Definition: observed_value.hpp:126
std::vector< EventContext::EventIdType > attachedEvents_
Definition: observed_value.hpp:127
std::vector< EventContext::EventIdType > attachedOneshotEvents_
Definition: observed_value.hpp:128
Definition: observed_value.hpp:631
ObservedContainer(CustomEventContextFlag_t, EventContext *ctx, RangeEventContext &&rangeContext)
Definition: observed_value.hpp:681
ObservedContainer()
Definition: observed_value.hpp:659
iterator erase(const_iterator first, const_iterator last)
Definition: observed_value.hpp:988
iterator insert(iterator pos, std::initializer_list< value_type > ilist)
Definition: observed_value.hpp:944
~ObservedContainer()
Definition: observed_value.hpp:703
void swap(ContainerT &other)
Definition: observed_value.hpp:1091
const_reference front() const
Definition: observed_value.hpp:745
std::shared_ptr< RangeEventContext > rangeContext_
Definition: observed_value.hpp:1196
const_reference at(size_type pos) const
Definition: observed_value.hpp:769
Detail::PickFirst_t< std::pair< typename ContainerT::iterator, bool >, decltype(std::declval< U >).insert(std::declval< value_type && >)))> insert(value_type &&value)
Definition: observed_value.hpp:888
reference front()
Definition: observed_value.hpp:741
iterator erase(iterator pos)
Definition: observed_value.hpp:963
Detail::PickFirst_t< void, decltype(std::declval< U >).reserve(std::declval< std::size_t >)))> reserve(size_type capacity)
Definition: observed_value.hpp:848
const_reverse_iterator rend() const noexcept
Definition: observed_value.hpp:819
typename ContainerT::allocator_type allocator_type
Definition: observed_value.hpp:637
void insertRangeChecked(std::size_t low, std::size_t high, RangeOperationType type)
Definition: observed_value.hpp:1126
const_reference back() const
Definition: observed_value.hpp:753
typename ContainerT::const_pointer const_pointer
Definition: observed_value.hpp:643
Detail::PickFirst_t< void, decltype(std::declval< U >).resize(std::declval< std::size_t >), std::declval< value_type const & >)))> resize(size_type count, value_type const &fillValue)
Definition: observed_value.hpp:1077
const_iterator end() const noexcept
Definition: observed_value.hpp:795
auto registerAfterEffect()
Definition: observed_value.hpp:1170
Detail::PickFirst_t< void, decltype(std::declval< U >).resize(std::declval< std::size_t >)))> resize(size_type count)
Definition: observed_value.hpp:1056
EventContext::EventIdType afterEffectId_
Definition: observed_value.hpp:1197
ObservedContainer(CustomEventContextFlag_t, EventContext *ctx, T &&t)
Definition: observed_value.hpp:665
iterator end() noexcept
Definition: observed_value.hpp:791
reference at(size_type pos)
Definition: observed_value.hpp:765
ObservedContainer & operator=(const ObservedContainer &)=delete
reverse_iterator rend() noexcept
Definition: observed_value.hpp:815
const_reference operator[](size_type pos) const
Definition: observed_value.hpp:777
iterator insert(iterator pos, value_type &&value)
Definition: observed_value.hpp:909
reference back()
Definition: observed_value.hpp:749
const_pointer data() const noexcept
Definition: observed_value.hpp:761
iterator insert(const_iterator pos, value_type &&value)
Definition: observed_value.hpp:913
void assign(std::initializer_list< value_type > ilist)
Definition: observed_value.hpp:733
void assign(Iterator first, Iterator last)
Definition: observed_value.hpp:727
ObservedContainer & operator=(ObservedContainer &&)=default
ObservedContainer & operator=(T &&t)
Definition: observed_value.hpp:713
iterator begin() noexcept
Definition: observed_value.hpp:783
const_reverse_iterator rbegin() const noexcept
Definition: observed_value.hpp:811
constexpr auto map(auto &&function) const
Definition: range.hpp:153
ObservedContainer(RangeEventContext &&rangeContext)
Definition: observed_value.hpp:676
pointer data() noexcept
Definition: observed_value.hpp:757
const_reverse_iterator crbegin() const noexcept
Definition: observed_value.hpp:823
const_iterator begin() const noexcept
Definition: observed_value.hpp:787
iterator insert(const_iterator pos, const value_type &value)
Definition: observed_value.hpp:902
ObservedContainer(ObservedContainer &&)=default
Detail::PickFirst_t< void, decltype(std::declval< U >).push_front(std::declval< const value_type & >)))> push_front(const value_type &value)
Definition: observed_value.hpp:1013
typename ContainerT::size_type size_type
Definition: observed_value.hpp:638
ObservedContainer(T &&t, RangeEventContext &&rangeContext)
Definition: observed_value.hpp:687
iterator insert(const_iterator pos, std::initializer_list< value_type > ilist)
Definition: observed_value.hpp:948
Detail::PickFirst_t< std::size_t, decltype(std::declval< U >).capacity())> capacity() const noexcept
Definition: observed_value.hpp:853
Detail::PickFirst_t< std::size_t, decltype(std::declval< U >).max_size())> max_size() const noexcept
Definition: observed_value.hpp:842
iterator insert(const_iterator pos, Iterator first, Iterator last)
Definition: observed_value.hpp:937
Detail::PickFirst_t< void, decltype(std::declval< U >).push_back(std::declval< value_type >)))> push_back(value_type &&value)
Definition: observed_value.hpp:1006
ObservedContainer(const ObservedContainer &)=delete
iterator erase(const_iterator pos)
Definition: observed_value.hpp:971
void emplace_back(Args &&... args)
Definition: observed_value.hpp:1026
const_reverse_iterator crend() const noexcept
Definition: observed_value.hpp:827
typename ContainerT::value_type value_type
Definition: observed_value.hpp:636
void update(bool force=false) const override
Definition: observed_value.hpp:1117
iterator insert(const_iterator pos, size_type count, const value_type &value)
Definition: observed_value.hpp:924
Detail::PickFirst_t< void, decltype(std::declval< U >).emplace_front())> emplace_front(Args &&... args)
Definition: observed_value.hpp:1032
reference operator[](size_type pos)
Definition: observed_value.hpp:773
iterator emplace(const_iterator pos, Args &&... args)
Definition: observed_value.hpp:956
void pop_back()
Definition: observed_value.hpp:1037
Detail::PickFirst_t< std::pair< typename ContainerT::iterator, bool >, decltype(std::declval< U >).insert(std::declval< const value_type & >)))> insert(const value_type &value)
Definition: observed_value.hpp:874
Detail::PickFirst_t< void, decltype(std::declval< U >).push_front(std::declval< value_type >)))> push_front(value_type &&value)
Definition: observed_value.hpp:1020
const_iterator cend() const noexcept
Definition: observed_value.hpp:803
iterator insert(iterator pos, Iterator first, Iterator last)
Definition: observed_value.hpp:932
reverse_iterator rbegin() noexcept
Definition: observed_value.hpp:807
Detail::PickFirst_t< void, decltype(std::declval< U >).pop_front())> pop_front()
Definition: observed_value.hpp:1046
const_iterator cbegin() const noexcept
Definition: observed_value.hpp:799
typename ContainerT::const_reverse_iterator const_reverse_iterator
Definition: observed_value.hpp:649
void assign(size_type count, const value_type &value)
Definition: observed_value.hpp:720
typename ContainerT::const_iterator const_iterator
Definition: observed_value.hpp:646
iterator erase(iterator first, iterator last)
Definition: observed_value.hpp:979
ObservedContainer(T &&t)
Definition: observed_value.hpp:671
bool empty() const noexcept
Definition: observed_value.hpp:833
ContainerT & value()
Definition: observed_value.hpp:1099
void eraseNotify(std::size_t index, std::size_t high)
Definition: observed_value.hpp:1184
MoveDetector moveDetector_
Definition: observed_value.hpp:1195
std::size_t size() const noexcept
Definition: observed_value.hpp:837
Detail::PickFirst_t< void, decltype(std::declval< U >).push_back(std::declval< const value_type & >)))> push_back(const value_type &value)
Definition: observed_value.hpp:999
typename ContainerT::difference_type difference_type
Definition: observed_value.hpp:639
RangeEventContext & rangeContext()
Definition: observed_value.hpp:1107
typename ContainerT::const_reference const_reference
Definition: observed_value.hpp:641
iterator insert(iterator pos, size_type count, const value_type &value)
Definition: observed_value.hpp:920
ObservedContainer(CustomEventContextFlag_t, EventContext *ctx, T &&t, RangeEventContext &&rangeContext)
Definition: observed_value.hpp:693
void clear()
Definition: observed_value.hpp:864
ContainerT const & value() const
Definition: observed_value.hpp:1103
RangeEventContext const & rangeContext() const
Definition: observed_value.hpp:1111
iterator insert(iterator pos, const value_type &value)
Definition: observed_value.hpp:898
Detail::PickFirst_t< void, decltype(std::declval< U >).shrink_to_fit())> shrink_to_fit()
Definition: observed_value.hpp:858
Observed< std::basic_string< Parameters... > > & operator=(std::basic_string< Parameters... > const &contained)
Definition: observed_value.hpp:1268
Observed< std::basic_string< Parameters... > > & erase(std::size_t index=0, std::size_t count=std::string::npos)
Definition: observed_value.hpp:1279
Observed< std::basic_string< Parameters... > > & operator=(std::basic_string< Parameters... > &&contained)
Definition: observed_value.hpp:1273
Observed< std::deque< Parameters... > > & operator=(std::deque< Parameters... > &&contained)
Definition: observed_value.hpp:1253
Observed< std::deque< Parameters... > > & operator=(std::deque< Parameters... > const &contained)
Definition: observed_value.hpp:1248
Observed()
Definition: observed_value.hpp:1330
Observed< std::list< Parameters... > > & operator=(std::list< Parameters... > const &contained)
Definition: observed_value.hpp:1338
Observed(T &&t)
Definition: observed_value.hpp:1334
Observed< std::list< Parameters... > > & operator=(std::list< Parameters... > &&contained)
Definition: observed_value.hpp:1343
Observed(T &&t)
Definition: observed_value.hpp:1305
Observed< std::set< Parameters... > > & operator=(std::set< Parameters... > &&contained)
Definition: observed_value.hpp:1314
Observed< std::set< Parameters... > > & operator=(std::set< Parameters... > const &contained)
Definition: observed_value.hpp:1309
Observed()
Definition: observed_value.hpp:1301
Observed< std::vector< Parameters... > > & operator=(std::vector< Parameters... > &&contained)
Definition: observed_value.hpp:1233
Observed< std::vector< Parameters... > > & operator=(std::vector< Parameters... > const &contained)
Definition: observed_value.hpp:1228
Definition: observed_value.hpp:1352
void modify() const
Definition: observed_value.hpp:1357
void modifyNow() const
Definition: observed_value.hpp:1362
Definition: observed_value.hpp:1202
Observed & operator=(T const &contained)
Definition: observed_value.hpp:1208
Observed & operator=(T &&contained)
Definition: observed_value.hpp:1213
Definition: range_event_context.hpp:187
auto & unwrapReferenceWrapper(ReferenceWrapper< T, ContainerT > &wrapper)
Definition: observed_value.hpp:433
typename ObservedAddReference< std::decay_t< T > >::type ObservedAddReference_t
Definition: observed_value.hpp:1545
typename PickFirst< Ts... >::type PickFirst_t
Definition: pick_first.hpp:22
typename ObservedAddMutableReference< std::remove_reference_t< T > >::type ObservedAddMutableReference_t
Definition: observed_value.hpp:1547
typename ObservedAddMutableReference< std::remove_reference_t< T > >::raw ObservedAddMutableReference_raw
Definition: observed_value.hpp:1549
Definition: file_dialog.hpp:6
typename UnpackObserved< T >::type UnpackObserved_t
Definition: observed_value.hpp:1583
concept IsSharedObserved
Definition: observed_value.hpp:1453
concept IsObserved
Definition: observed_value.hpp:1451
requires Incrementable< T > ModifiableObserved< T > & operator++(ModifiableObserved< T > &observedValue)
Definition: observed_value.hpp:1416
RangeOperationType
Definition: range_event_context.hpp:17
@ Modify
Definition: range_event_context.hpp:19
@ Insert
Definition: range_event_context.hpp:20
@ Erase
Definition: range_event_context.hpp:21
thread_local EventContext globalEventContext
Definition: event_context.cpp:5
requires(IsObservedLike< ObservedValues > &&...) ObservedValueCombinator< std
Definition: observed_value_combinator.hpp:191
auto operator--(ModifiableObserved< T > &observedValue) -> ModifiableObserved< Detail::PickFirst_t< T, decltype(--std::declval< T >())>> &
Definition: observed_value.hpp:1433
emscripten::val val
Definition: val.hpp:5
concept IsWeakObserved
Definition: observed_value.hpp:1455
constexpr CustomEventContextFlag_t CustomEventContextFlag
Definition: observed_value.hpp:27
concept IsObservedLike
Definition: observed_value.hpp:1457
Definition: observed_value.hpp:26
Definition: observed_value.hpp:1463
constexpr CopyableObservedWrap(Observed< T > const &observed)
Definition: observed_value.hpp:1465
void detachEvent(auto eventId) const
Definition: observed_value.hpp:1479
T const & value() const
Definition: observed_value.hpp:1469
void attachEvent(auto eventId) const
Definition: observed_value.hpp:1474
Definition: observed_value.hpp:1408
Definition: observed_value.hpp:1372
Definition: observed_value.hpp:1396
Definition: observed_value.hpp:1384
std::weak_ptr< Observed< T > > type
Definition: observed_value.hpp:1540
std::weak_ptr< Observed< T > > type
Definition: observed_value.hpp:1534
void raw
Definition: observed_value.hpp:1529
void type
Definition: observed_value.hpp:1528
Definition: observed_value.hpp:1521
T raw
Definition: observed_value.hpp:1523
T & type
Definition: observed_value.hpp:1522
std::weak_ptr< Observed< T > > type
Definition: observed_value.hpp:1506
std::weak_ptr< const Observed< T > > type
Definition: observed_value.hpp:1516
std::weak_ptr< Observed< T > > type
Definition: observed_value.hpp:1501
std::weak_ptr< const Observed< T > > type
Definition: observed_value.hpp:1511
void type
Definition: observed_value.hpp:1496
Definition: observed_value.hpp:1490
T const & type
Definition: observed_value.hpp:1491
T type
Definition: observed_value.hpp:1560
T type
Definition: observed_value.hpp:1570
T type
Definition: observed_value.hpp:1580
T type
Definition: observed_value.hpp:1565
T type
Definition: observed_value.hpp:1575
Definition: observed_value.hpp:1554
T type
Definition: observed_value.hpp:1555