Skip to content

Commit ca9f730

Browse files
committed
Cleanup + prefixedT alias names to avoid ambiguity.
1 parent 66f665a commit ca9f730

15 files changed

Lines changed: 243 additions & 244 deletions

‎include/react/EventStream.h‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,45 +28,45 @@ enum class EventToken
2828
};
2929

3030
///////////////////////////////////////////////////////////////////////////////////////////////////
31-
/// REvents
31+
/// Events
3232
///////////////////////////////////////////////////////////////////////////////////////////////////
3333
template
3434
<
3535
typename D,
3636
typename E = EventToken
3737
>
38-
class REvents : public Reactive<REACT_IMPL::EventStreamNode<D,E>>
38+
class Events : public Reactive<REACT_IMPL::EventStreamNode<D,E>>
3939
{
4040
protected:
4141
using NodeT = REACT_IMPL::EventStreamNode<D, E>;
4242

4343
public:
4444
using ValueT = E;
4545

46-
REvents() :
46+
Events() :
4747
Reactive()
4848
{
4949
}
5050

51-
explicit REvents(const std::shared_ptr<NodeT>& ptr) :
51+
explicit Events(const std::shared_ptr<NodeT>& ptr) :
5252
Reactive(ptr)
5353
{
5454
}
5555

5656
template <typename F>
57-
REvents Filter(F&& f)
57+
Events Filter(F&& f)
5858
{
5959
return react::Filter(*this, std::forward<F>(f));
6060
}
6161

6262
template <typename F>
63-
REvents Transform(F&& f)
63+
Events Transform(F&& f)
6464
{
6565
return react::Transform(*this, std::forward<F>(f));
6666
}
6767

6868
template <typename F>
69-
RObserver<D> Observe(F&& f)
69+
Observer<D> Observe(F&& f)
7070
{
7171
return react::Observe(*this, std::forward<F>(f));
7272
}
@@ -77,7 +77,7 @@ class REvents : public Reactive<REACT_IMPL::EventStreamNode<D,E>>
7777
/***************************************/ REACT_IMPL_BEGIN /**************************************/
7878

7979
template <typename D, typename L, typename R>
80-
bool Equals(const REvents<D,L>& lhs, const REvents<D,R>& rhs)
80+
bool Equals(const Events<D,L>& lhs, const Events<D,R>& rhs)
8181
{
8282
return lhs.Equals(rhs);
8383
}
@@ -87,26 +87,26 @@ bool Equals(const REvents<D,L>& lhs, const REvents<D,R>& rhs)
8787
/*****************************************/ REACT_BEGIN /*****************************************/
8888

8989
///////////////////////////////////////////////////////////////////////////////////////////////////
90-
/// REventSource
90+
/// Eventsource
9191
///////////////////////////////////////////////////////////////////////////////////////////////////
9292
template
9393
<
9494
typename D,
9595
typename E = EventToken
9696
>
97-
class REventSource : public REvents<D,E>
97+
class EventSource : public Events<D,E>
9898
{
9999
private:
100100
using NodeT = REACT_IMPL::EventSourceNode<D, E>;
101101

102102
public:
103-
REventSource() :
104-
REvents()
103+
EventSource() :
104+
Events()
105105
{
106106
}
107107

108-
explicit REventSource(const std::shared_ptr<NodeT>& ptr) :
109-
REvents(ptr)
108+
explicit EventSource(const std::shared_ptr<NodeT>& ptr) :
109+
Events(ptr)
110110
{
111111
}
112112

@@ -122,7 +122,7 @@ class REventSource : public REvents<D,E>
122122
Emit(EventToken::token);
123123
}
124124

125-
const REventSource& operator<<(const E& e) const
125+
const EventSource& operator<<(const E& e) const
126126
{
127127
Emit(e);
128128
return *this;
@@ -134,17 +134,17 @@ class REventSource : public REvents<D,E>
134134
///////////////////////////////////////////////////////////////////////////////////////////////////
135135
template <typename D, typename E>
136136
auto MakeEventSource()
137-
-> REventSource<D,E>
137+
-> EventSource<D,E>
138138
{
139-
return REventSource<D,E>(
139+
return EventSource<D,E>(
140140
std::make_shared<REACT_IMPL::EventSourceNode<D,E>>(false));
141141
}
142142

143143
template <typename D>
144144
auto MakeEventSource()
145-
-> REventSource<D,EventToken>
145+
-> EventSource<D,EventToken>
146146
{
147-
return REventSource<D,EventToken>(
147+
return EventSource<D,EventToken>(
148148
std::make_shared<REACT_IMPL::EventSourceNode<D,EventToken>>(false));
149149
}
150150

@@ -157,15 +157,15 @@ template
157157
typename TArg1,
158158
typename ... TArgs
159159
>
160-
inline auto Merge(const REvents<D,TArg1>& arg1,
161-
const REvents<D,TArgs>& ... args)
162-
-> REvents<D,TArg1>
160+
inline auto Merge(const Events<D,TArg1>& arg1,
161+
const Events<D,TArgs>& ... args)
162+
-> Events<D,TArg1>
163163
{
164164
static_assert(sizeof...(TArgs) > 0,
165165
"react::Merge requires at least 2 arguments.");
166166

167167
typedef TArg1 E;
168-
return REvents<D,E>(
168+
return Events<D,E>(
169169
std::make_shared<REACT_IMPL::EventMergeNode<D, E, TArg1, TArgs ...>>(
170170
arg1.GetPtr(), args.GetPtr() ..., false));
171171
}
@@ -176,9 +176,9 @@ template
176176
typename TLeftArg,
177177
typename TRightArg
178178
>
179-
inline auto operator|(const REvents<D,TLeftArg>& lhs,
180-
const REvents<D,TRightArg>& rhs)
181-
-> REvents<D, TLeftArg>
179+
inline auto operator|(const Events<D,TLeftArg>& lhs,
180+
const Events<D,TRightArg>& rhs)
181+
-> Events<D, TLeftArg>
182182
{
183183
return Merge(lhs,rhs);
184184
}
@@ -192,10 +192,10 @@ template
192192
typename E,
193193
typename F
194194
>
195-
inline auto Filter(const REvents<D,E>& src, F&& filter)
196-
-> REvents<D,E>
195+
inline auto Filter(const Events<D,E>& src, F&& filter)
196+
-> Events<D,E>
197197
{
198-
return REvents<D,E>(
198+
return Events<D,E>(
199199
std::make_shared<REACT_IMPL::EventFilterNode<D, E>>(
200200
src.GetPtr(), std::forward<F>(filter), false));
201201
}
@@ -209,12 +209,12 @@ template
209209
typename TIn,
210210
typename F
211211
>
212-
inline auto Transform(const REvents<D,TIn>& src, F&& func)
213-
-> REvents<D, typename std::result_of<F(TIn)>::type>
212+
inline auto Transform(const Events<D,TIn>& src, F&& func)
213+
-> Events<D, typename std::result_of<F(TIn)>::type>
214214
{
215215
using TOut = typename std::result_of<F(TIn)>::type;
216216

217-
return REvents<D,TOut>(
217+
return Events<D,TOut>(
218218
std::make_shared<REACT_IMPL::EventTransformNode<D, TIn, TOut>>(
219219
src.GetPtr(), std::forward<F>(func), false));
220220
}

‎include/react/Observer.h‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@ template <typename T>
2121
class Reactive;
2222

2323
template <typename D, typename S>
24-
class RSignal;
24+
class Signal;
2525

2626
template <typename D, typename E>
27-
class REvents;
27+
class Events;
2828

2929
enum class EventToken;
3030

3131
///////////////////////////////////////////////////////////////////////////////////////////////////
32-
/// RObserver
32+
/// Observer
3333
///////////////////////////////////////////////////////////////////////////////////////////////////
3434
template <typename D>
35-
class RObserver
35+
class Observer
3636
{
3737
public:
3838
using SubjectT = REACT_IMPL::NodeBase<D>;
3939
using ObserverNodeT = REACT_IMPL::ObserverNode<D>;
4040

41-
RObserver() :
41+
Observer() :
4242
ptr_{ nullptr },
4343
subject_{ nullptr }
4444
{
4545
}
4646

47-
RObserver(ObserverNodeT* ptr, const std::shared_ptr<SubjectT>& subject) :
47+
Observer(ObserverNodeT* ptr, const std::shared_ptr<SubjectT>& subject) :
4848
ptr_{ ptr },
4949
subject_{ subject }
5050
{
@@ -155,8 +155,8 @@ template
155155
typename F,
156156
typename TArg
157157
>
158-
inline auto Observe(const RSignal<D,TArg>& subject, F&& func)
159-
-> RObserver<D>
158+
inline auto Observe(const Signal<D,TArg>& subject, F&& func)
159+
-> Observer<D>
160160
{
161161
std::unique_ptr< REACT_IMPL::ObserverNode<D>> pUnique(
162162
new REACT_IMPL::SignalObserverNode<D,TArg>(
@@ -166,7 +166,7 @@ inline auto Observe(const RSignal<D,TArg>& subject, F&& func)
166166

167167
D::Observers().Register(std::move(pUnique), subject.GetPtr().get());
168168

169-
return RObserver<D>(raw, subject.GetPtr());
169+
return Observer<D>(raw, subject.GetPtr());
170170
}
171171

172172
template
@@ -177,8 +177,8 @@ template
177177
typename = std::enable_if<
178178
! std::is_same<TArg,EventToken>::value>::type
179179
>
180-
inline auto Observe(const REvents<D,TArg>& subject, F&& func)
181-
-> RObserver<D>
180+
inline auto Observe(const Events<D,TArg>& subject, F&& func)
181+
-> Observer<D>
182182
{
183183
std::unique_ptr< REACT_IMPL::ObserverNode<D>> pUnique(
184184
new REACT_IMPL::EventObserverNode<D,TArg>(
@@ -188,16 +188,16 @@ inline auto Observe(const REvents<D,TArg>& subject, F&& func)
188188

189189
D::Observers().Register(std::move(pUnique), subject.GetPtr().get());
190190

191-
return RObserver<D>(raw, subject.GetPtr());
191+
return Observer<D>(raw, subject.GetPtr());
192192
}
193193

194194
template
195195
<
196196
typename D,
197197
typename F
198198
>
199-
inline auto Observe(const REvents<D,EventToken>& subject, F&& func)
200-
-> RObserver<D>
199+
inline auto Observe(const Events<D,EventToken>& subject, F&& func)
200+
-> Observer<D>
201201
{
202202
std::unique_ptr< REACT_IMPL::ObserverNode<D>> pUnique(
203203
new REACT_IMPL::EventObserverNode<D,EventToken>(
@@ -207,7 +207,7 @@ inline auto Observe(const REvents<D,EventToken>& subject, F&& func)
207207

208208
D::Observers().Register(std::move(pUnique), subject.GetPtr().get());
209209

210-
return RObserver<D>(raw, subject.GetPtr());
210+
return Observer<D>(raw, subject.GetPtr());
211211
}
212212

213213
///////////////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)