summaryrefslogtreecommitdiff
path: root/Rx/v2
diff options
context:
space:
mode:
authorKirk Shoop <kirk.shoop@microsoft.com>2014-05-08 08:18:07 -0700
committerKirk Shoop <kirk.shoop@microsoft.com>2014-05-13 16:30:33 -0600
commita691721dd4fb201c4b1799ad562bd3ee07adf611 (patch)
tree95932bf06e971bb1e46b2fe70878608e0646326a /Rx/v2
parent59d9d055fe64e4f9b56e0ed125b985e319004bb0 (diff)
downloadRxCpp-a691721dd4fb201c4b1799ad562bd3ee07adf611.tar.gz
rename connect_now to connect_forever
Diffstat (limited to 'Rx/v2')
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp (renamed from Rx/v2/src/rxcpp/operators/rx-connect_now.hpp)24
-rw-r--r--Rx/v2/src/rxcpp/rx-connectable_observable.hpp10
-rw-r--r--Rx/v2/src/rxcpp/rx-operators.hpp2
-rw-r--r--Rx/v2/test/operators/publish.cpp6
4 files changed, 21 insertions, 21 deletions
diff --git a/Rx/v2/src/rxcpp/operators/rx-connect_now.hpp b/Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp
index ff998f0..35e000f 100644
--- a/Rx/v2/src/rxcpp/operators/rx-connect_now.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-connect_forever.hpp
@@ -2,8 +2,8 @@
#pragma once
-#if !defined(RXCPP_OPERATORS_RX_CONNECT_NOW_HPP)
-#define RXCPP_OPERATORS_RX_CONNECT_NOW_HPP
+#if !defined(RXCPP_OPERATORS_RX_CONNECT_FOREVER_HPP)
+#define RXCPP_OPERATORS_RX_CONNECT_FOREVER_HPP
#include "../rx-includes.hpp"
@@ -14,13 +14,13 @@ namespace operators {
namespace detail {
template<class T, class ConnectableObservable>
-struct connect_now : public operator_base<T>
+struct connect_forever : public operator_base<T>
{
typedef typename std::decay<ConnectableObservable>::type source_type;
source_type source;
- explicit connect_now(source_type o)
+ explicit connect_forever(source_type o)
: source(std::move(o))
{
source.connect();
@@ -32,23 +32,23 @@ struct connect_now : public operator_base<T>
}
};
-class connect_now_factory
+class connect_forever_factory
{
public:
- connect_now_factory() {}
+ connect_forever_factory() {}
template<class Observable>
auto operator()(Observable&& source)
- -> observable<typename std::decay<Observable>::type::value_type, connect_now<typename std::decay<Observable>::type::value_type, Observable>> {
- return observable<typename std::decay<Observable>::type::value_type, connect_now<typename std::decay<Observable>::type::value_type, Observable>>(
- connect_now<typename std::decay<Observable>::type::value_type, Observable>(std::forward<Observable>(source)));
+ -> observable<typename std::decay<Observable>::type::value_type, connect_forever<typename std::decay<Observable>::type::value_type, Observable>> {
+ return observable<typename std::decay<Observable>::type::value_type, connect_forever<typename std::decay<Observable>::type::value_type, Observable>>(
+ connect_forever<typename std::decay<Observable>::type::value_type, Observable>(std::forward<Observable>(source)));
}
};
}
-inline auto connect_now()
- -> detail::connect_now_factory {
- return detail::connect_now_factory();
+inline auto connect_forever()
+ -> detail::connect_forever_factory {
+ return detail::connect_forever_factory();
}
}
diff --git a/Rx/v2/src/rxcpp/rx-connectable_observable.hpp b/Rx/v2/src/rxcpp/rx-connectable_observable.hpp
index bf63dd0..5fa2d59 100644
--- a/Rx/v2/src/rxcpp/rx-connectable_observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-connectable_observable.hpp
@@ -184,16 +184,16 @@ public:
rxo::detail::ref_count<T, this_type>(*this));
}
- /// connect_now ->
+ /// connect_forever ->
/// takes a connectable_observable source and calls connect during
/// the construction of the expression. This means that the source
/// starts running without any subscribers and continues running
/// after all subscriptions have been unsubscribed.
///
- auto connect_now() const
- -> observable<T, rxo::detail::connect_now<T, this_type>> {
- return observable<T, rxo::detail::connect_now<T, this_type>>(
- rxo::detail::connect_now<T, this_type>(*this));
+ auto connect_forever() const
+ -> observable<T, rxo::detail::connect_forever<T, this_type>> {
+ return observable<T, rxo::detail::connect_forever<T, this_type>>(
+ rxo::detail::connect_forever<T, this_type>(*this));
}
};
diff --git a/Rx/v2/src/rxcpp/rx-operators.hpp b/Rx/v2/src/rxcpp/rx-operators.hpp
index b0fa902..67bb79f 100644
--- a/Rx/v2/src/rxcpp/rx-operators.hpp
+++ b/Rx/v2/src/rxcpp/rx-operators.hpp
@@ -40,7 +40,7 @@ namespace rxo=operators;
#include "operators/rx-flat_map.hpp"
#include "operators/rx-publish.hpp"
#include "operators/rx-ref_count.hpp"
-#include "operators/rx-connect_now.hpp"
+#include "operators/rx-connect_forever.hpp"
#include "operators/rx-take.hpp"
#include "operators/rx-take_until.hpp"
diff --git a/Rx/v2/test/operators/publish.cpp b/Rx/v2/test/operators/publish.cpp
index 02d799b..729464d 100644
--- a/Rx/v2/test/operators/publish.cpp
+++ b/Rx/v2/test/operators/publish.cpp
@@ -35,9 +35,9 @@ SCENARIO("publish range", "[hide][range][subject][publish][operators]"){
// on_completed
[](){std::cout << " done." << std::endl;});
}
- WHEN("connect_now is used"){
- auto published = rxs::range<int>(0, 10).publish().connect_now();
- std::cout << "subscribe to connect_now" << std::endl;
+ WHEN("connect_forever is used"){
+ auto published = rxs::range<int>(0, 10).publish().connect_forever();
+ std::cout << "subscribe to connect_forever" << std::endl;
published.subscribe(
// on_next
[](int v){std::cout << v << ", ";},