| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b7b227d commit 77de3d6
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,7 @@ class Events : public REACT_IMPL::EventStreamBase<D,E> | |||
| 48 | 48 | ||
| 49 | 49 | private: | |
| 50 | 50 | using NodeT = REACT_IMPL::EventStreamNode<D,E>; | |
| 51 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 51 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 52 | 52 | ||
| 53 | 53 | public: | |
| 54 | 54 | using ValueT = E; | |
@@ -115,7 +115,7 @@ class Events<D,E&> : public REACT_IMPL::EventStreamBase<D,std::reference_wrapper | |||
| 115 | 115 | ||
| 116 | 116 | private: | |
| 117 | 117 | using NodeT = REACT_IMPL::EventStreamNode<D,std::reference_wrapper<E>>; | |
| 118 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 118 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 119 | 119 | ||
| 120 | 120 | public: | |
| 121 | 121 | using ValueT = E; | |
@@ -181,7 +181,7 @@ class EventSource : public Events<D,E> | |||
| 181 | 181 | { | |
| 182 | 182 | private: | |
| 183 | 183 | using NodeT = REACT_IMPL::EventSourceNode<D,E>; | |
| 184 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 184 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 185 | 185 | ||
| 186 | 186 | public: | |
| 187 | 187 | EventSource() = default; | |
@@ -233,7 +233,7 @@ class EventSource<D,E&> : public Events<D,std::reference_wrapper<E>> | |||
| 233 | 233 | { | |
| 234 | 234 | private: | |
| 235 | 235 | using NodeT = REACT_IMPL::EventSourceNode<D,std::reference_wrapper<E>>; | |
| 236 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 236 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 237 | 237 | ||
| 238 | 238 | public: | |
| 239 | 239 | EventSource() = default; | |
@@ -274,7 +274,7 @@ class TempEvents : public Events<D,E> | |||
| 274 | 274 | { | |
| 275 | 275 | protected: | |
| 276 | 276 | using NodeT = REACT_IMPL::EventOpNode<D,E,TOp>; | |
| 277 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 277 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 278 | 278 | ||
| 279 | 279 | public: | |
| 280 | 280 | TempEvents() = default; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ class Signal : public REACT_IMPL::SignalBase<D,S> | |||
| 34 | 34 | ||
| 35 | 35 | private: | |
| 36 | 36 | using NodeT = REACT_IMPL::SignalNode<D,S>; | |
| 37 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 37 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 38 | 38 | ||
| 39 | 39 | public: | |
| 40 | 40 | using ValueT = S; | |
@@ -83,7 +83,7 @@ class Signal<D,S&> : public REACT_IMPL::SignalBase<D,std::reference_wrapper<S>> | |||
| 83 | 83 | ||
| 84 | 84 | private: | |
| 85 | 85 | using NodeT = REACT_IMPL::SignalNode<D,std::reference_wrapper<S>>; | |
| 86 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 86 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 87 | 87 | ||
| 88 | 88 | public: | |
| 89 | 89 | using ValueT = S; | |
@@ -125,7 +125,7 @@ class VarSignal : public Signal<D,S> | |||
| 125 | 125 | { | |
| 126 | 126 | private: | |
| 127 | 127 | using NodeT = REACT_IMPL::VarNode<D,S>; | |
| 128 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 128 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 129 | 129 | ||
| 130 | 130 | public: | |
| 131 | 131 | VarSignal() = default; | |
@@ -172,7 +172,7 @@ class VarSignal<D,S&> : public Signal<D,std::reference_wrapper<S>> | |||
| 172 | 172 | { | |
| 173 | 173 | private: | |
| 174 | 174 | using NodeT = REACT_IMPL::VarNode<D,std::reference_wrapper<S>>; | |
| 175 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 175 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 176 | 176 | ||
| 177 | 177 | public: | |
| 178 | 178 | using ValueT = S; | |
@@ -213,7 +213,7 @@ class TempSignal : public Signal<D,S> | |||
| 213 | 213 | { | |
| 214 | 214 | private: | |
| 215 | 215 | using NodeT = REACT_IMPL::SignalOpNode<D,S,TOp>; | |
| 216 | - using NodePtrT = REACT_IMPL::SharedPtrT<NodeT>; | ||
| 216 | + using NodePtrT = std::shared_ptr<NodeT>; | ||
| 217 | 217 | ||
| 218 | 218 | public: | |
| 219 | 219 | TempSignal() = default; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ class ReactiveBase | |||
| 35 | 35 | { | |
| 36 | 36 | public: | |
| 37 | 37 | using DomainT = typename TNode::DomainT; | |
| 38 | - using NodePtrT = SharedPtrT<TNode>; | ||
| 38 | + using NodePtrT = std::shared_ptr<TNode>; | ||
| 39 | 39 | ||
| 40 | 40 | ReactiveBase() = default; | |
| 41 | 41 | ReactiveBase(const ReactiveBase&) = default; | |
@@ -52,7 +52,7 @@ class ReactiveBase | |||
| 52 | 52 | ptr_{ std::move(ptr) } | |
| 53 | 53 | {} | |
| 54 | 54 | ||
| 55 | - const SharedPtrT<TNode>& NodePtr() const | ||
| 55 | + const std::shared_ptr<TNode>& NodePtr() const | ||
| 56 | 56 | { | |
| 57 | 57 | return ptr_; | |
| 58 | 58 | } | |
@@ -68,7 +68,7 @@ class ReactiveBase | |||
| 68 | 68 | } | |
| 69 | 69 | ||
| 70 | 70 | protected: | |
| 71 | - SharedPtrT<TNode> ptr_; | ||
| 71 | + std::shared_ptr<TNode> ptr_; | ||
| 72 | 72 | }; | |
| 73 | 73 | ||
| 74 | 74 | /****************************************/ REACT_IMPL_END /***************************************/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | 9 | #include "react/detail/Defs.h" | |
| 10 | 10 | ||
| 11 | + #include <memory> | ||
| 11 | 12 | #include <utility> | |
| 12 | 13 | ||
| 13 | 14 | #include "EventNodes.h" | |
@@ -71,10 +72,10 @@ class IterateNode : public SignalNode<D,S> | |||
| 71 | 72 | } | |
| 72 | 73 | ||
| 73 | 74 | virtual const char* GetNodeType() const override { return "IterateNode"; } | |
| 74 | - virtual int DependencyCount() const override { return 1; } | ||
| 75 | + virtual int DependencyCount() const override { return 1; } | ||
| 75 | 76 | ||
| 76 | 77 | private: | |
| 77 | - SharedPtrT<EventStreamNode<D,E>> events_; | ||
| 78 | + std::shared_ptr<EventStreamNode<D,E>> events_; | ||
| 78 | 79 | ||
| 79 | 80 | TFunc func_; | |
| 80 | 81 | }; | |
@@ -93,7 +94,7 @@ class IterateByRefNode : public SignalNode<D,S> | |||
| 93 | 94 | { | |
| 94 | 95 | public: | |
| 95 | 96 | template <typename T, typename F> | |
| 96 | - IterateByRefNode(T&& init, const SharedPtrT<EventStreamNode<D,E>>& events, F&& func) : | ||
| 97 | + IterateByRefNode(T&& init, const std::shared_ptr<EventStreamNode<D,E>>& events, F&& func) : | ||
| 97 | 98 | SignalNode{ std::forward<T>(init) }, | |
| 98 | 99 | func_{ std::forward<F>(func) }, | |
| 99 | 100 | events_{ events } | |
@@ -132,7 +133,7 @@ class IterateByRefNode : public SignalNode<D,S> | |||
| 132 | 133 | protected: | |
| 133 | 134 | TFunc func_; | |
| 134 | 135 | ||
| 135 | - SharedPtrT<EventStreamNode<D,E>> events_; | ||
| 136 | + std::shared_ptr<EventStreamNode<D,E>> events_; | ||
| 136 | 137 | }; | |
| 137 | 138 | ||
| 138 | 139 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
@@ -168,7 +169,7 @@ class SyncedIterateNode : public SignalNode<D,S> | |||
| 168 | 169 | ||
| 169 | 170 | apply( | |
| 170 | 171 | DetachFunctor<D,SyncedIterateNode, | |
| 171 | - SharedPtrT<SignalNode<D,TDepValues>>...>{ *this }, | ||
| 172 | + std::shared_ptr<SignalNode<D,TDepValues>>...>{ *this }, | ||
| 172 | 173 | deps_); | |
| 173 | 174 | ||
| 174 | 175 | Engine::OnNodeDestroy(*this); | |
@@ -184,7 +185,7 @@ class SyncedIterateNode : public SignalNode<D,S> | |||
| 184 | 185 | MyFunc{ f } | |
| 185 | 186 | {} | |
| 186 | 187 | ||
| 187 | - S operator()(const SharedPtrT<SignalNode<D,TDepValues>>& ... args) | ||
| 188 | + S operator()(const std::shared_ptr<SignalNode<D,TDepValues>>& ... args) | ||
| 188 | 189 | { | |
| 189 | 190 | return MyFunc(MyEvent, MyValue, args->ValueRef() ...); | |
| 190 | 191 | } | |
@@ -231,9 +232,9 @@ class SyncedIterateNode : public SignalNode<D,S> | |||
| 231 | 232 | virtual int DependencyCount() const override { return 1 + sizeof...(TDepValues); } | |
| 232 | 233 | ||
| 233 | 234 | private: | |
| 234 | - using DepHolderT = std::tuple<SharedPtrT<SignalNode<D,TDepValues>>...>; | ||
| 235 | + using DepHolderT = std::tuple<std::shared_ptr<SignalNode<D,TDepValues>>...>; | ||
| 235 | 236 | ||
| 236 | - SharedPtrT<EventStreamNode<D,E>> events_; | ||
| 237 | + std::shared_ptr<EventStreamNode<D,E>> events_; | ||
| 237 | 238 | ||
| 238 | 239 | DepHolderT deps_; | |
| 239 | 240 | TFunc func_; | |
@@ -272,7 +273,7 @@ class SyncedIterateByRefNode : public SignalNode<D,S> | |||
| 272 | 273 | ||
| 273 | 274 | apply( | |
| 274 | 275 | DetachFunctor<D,SyncedIterateByRefNode, | |
| 275 | - SharedPtrT<SignalNode<D,TDepValues>>...>{ *this }, | ||
| 276 | + std::shared_ptr<SignalNode<D,TDepValues>>...>{ *this }, | ||
| 276 | 277 | deps_); | |
| 277 | 278 | ||
| 278 | 279 | Engine::OnNodeDestroy(*this); | |
@@ -288,7 +289,7 @@ class SyncedIterateByRefNode : public SignalNode<D,S> | |||
| 288 | 289 | MyFunc{ f } | |
| 289 | 290 | {} | |
| 290 | 291 | ||
| 291 | - void operator()(const SharedPtrT<SignalNode<D,TDepValues>>& ... args) | ||
| 292 | + void operator()(const std::shared_ptr<SignalNode<D,TDepValues>>& ... args) | ||
| 292 | 293 | { | |
| 293 | 294 | MyFunc(MyEvent, MyValue, args->ValueRef() ...); | |
| 294 | 295 | } | |
@@ -329,9 +330,9 @@ class SyncedIterateByRefNode : public SignalNode<D,S> | |||
| 329 | 330 | virtual int DependencyCount() const override { return 1 + sizeof...(TDepValues); } | |
| 330 | 331 | ||
| 331 | 332 | private: | |
| 332 | - using DepHolderT = std::tuple<SharedPtrT<SignalNode<D,TDepValues>>...>; | ||
| 333 | + using DepHolderT = std::tuple<std::shared_ptr<SignalNode<D,TDepValues>>...>; | ||
| 333 | 334 | ||
| 334 | - SharedPtrT<EventStreamNode<D,E>> events_; | ||
| 335 | + std::shared_ptr<EventStreamNode<D,E>> events_; | ||
| 335 | 336 | ||
| 336 | 337 | DepHolderT deps_; | |
| 337 | 338 | TFunc func_; | |
@@ -349,7 +350,7 @@ class HoldNode : public SignalNode<D,S> | |||
| 349 | 350 | { | |
| 350 | 351 | public: | |
| 351 | 352 | template <typename T> | |
| 352 | - HoldNode(T&& init, const SharedPtrT<EventStreamNode<D,S>>& events) : | ||
| 353 | + HoldNode(T&& init, const std::shared_ptr<EventStreamNode<D,S>>& events) : | ||
| 353 | 354 | SignalNode(std::forward<T>(init)), | |
| 354 | 355 | events_{ events } | |
| 355 | 356 | { | |
@@ -398,7 +399,7 @@ class HoldNode : public SignalNode<D,S> | |||
| 398 | 399 | virtual int DependencyCount() const override { return 1; } | |
| 399 | 400 | ||
| 400 | 401 | private: | |
| 401 | - const SharedPtrT<EventStreamNode<D,S>> events_; | ||
| 402 | + const std::shared_ptr<EventStreamNode<D,S>> events_; | ||
| 402 | 403 | }; | |
| 403 | 404 | ||
| 404 | 405 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
@@ -413,8 +414,8 @@ template | |||
| 413 | 414 | class SnapshotNode : public SignalNode<D,S> | |
| 414 | 415 | { | |
| 415 | 416 | public: | |
| 416 | - SnapshotNode(const SharedPtrT<SignalNode<D,S>>& target, | ||
| 417 | - const SharedPtrT<EventStreamNode<D,E>>& trigger) : | ||
| 417 | + SnapshotNode(const std::shared_ptr<SignalNode<D,S>>& target, | ||
| 418 | + const std::shared_ptr<EventStreamNode<D,E>>& trigger) : | ||
| 418 | 419 | SignalNode{ target->ValueRef() }, | |
| 419 | 420 | target_{ target }, | |
| 420 | 421 | trigger_{ trigger } | |
@@ -467,8 +468,8 @@ class SnapshotNode : public SignalNode<D,S> | |||
| 467 | 468 | } | |
| 468 | 469 | ||
| 469 | 470 | private: | |
| 470 | - const SharedPtrT<SignalNode<D,S>> target_; | ||
| 471 | - const SharedPtrT<EventStreamNode<D,E>> trigger_; | ||
| 471 | + const std::shared_ptr<SignalNode<D,S>> target_; | ||
| 472 | + const std::shared_ptr<EventStreamNode<D,E>> trigger_; | ||
| 472 | 473 | }; | |
| 473 | 474 | ||
| 474 | 475 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
@@ -482,7 +483,7 @@ template | |||
| 482 | 483 | class MonitorNode : public EventStreamNode<D,E> | |
| 483 | 484 | { | |
| 484 | 485 | public: | |
| 485 | - MonitorNode(const SharedPtrT<SignalNode<D,E>>& target) : | ||
| 486 | + MonitorNode(const std::shared_ptr<SignalNode<D,E>>& target) : | ||
| 486 | 487 | EventStreamNode{ }, | |
| 487 | 488 | target_{ target } | |
| 488 | 489 | { | |
@@ -521,7 +522,7 @@ class MonitorNode : public EventStreamNode<D,E> | |||
| 521 | 522 | } | |
| 522 | 523 | ||
| 523 | 524 | private: | |
| 524 | - const SharedPtrT<SignalNode<D,E>> target_; | ||
| 525 | + const std::shared_ptr<SignalNode<D,E>> target_; | ||
| 525 | 526 | }; | |
| 526 | 527 | ||
| 527 | 528 | /////////////////////////////////////////////////////////////////////////////////////////////////// | |
@@ -536,8 +537,8 @@ template | |||
| 536 | 537 | class PulseNode : public EventStreamNode<D,S> | |
| 537 | 538 | { | |
| 538 | 539 | public: | |
| 539 | - PulseNode(const SharedPtrT<SignalNode<D,S>>& target, | ||
| 540 | - const SharedPtrT<EventStreamNode<D,E>>& trigger) : | ||
| 540 | + PulseNode(const std::shared_ptr<SignalNode<D,S>>& target, | ||
| 541 | + const std::shared_ptr<EventStreamNode<D,E>>& trigger) : | ||
| 541 | 542 | EventStreamNode{ }, | |
| 542 | 543 | target_{ target }, | |
| 543 | 544 | trigger_{ trigger } | |
@@ -581,8 +582,8 @@ class PulseNode : public EventStreamNode<D,S> | |||
| 581 | 582 | } | |
| 582 | 583 | ||
| 583 | 584 | private: | |
| 584 | - const SharedPtrT<SignalNode<D,S>> target_; | ||
| 585 | - const SharedPtrT<EventStreamNode<D,E>> trigger_; | ||
| 585 | + const std::shared_ptr<SignalNode<D,S>> target_; | ||
| 586 | + const std::shared_ptr<EventStreamNode<D,E>> trigger_; | ||
| 586 | 587 | }; | |
| 587 | 588 | ||
| 588 | 589 | /****************************************/ REACT_IMPL_END /***************************************/ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments