summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrigoriy Chudnov <g.chudnov@gmail.com>2017-02-01 00:23:22 +0300
committerKirk Shoop <kirk.shoop@microsoft.com>2017-01-31 20:29:04 -0800
commitfdee23084b7e07dce1c422049214c918dc54d170 (patch)
treef3408671ae6e9862c065447035737ed36c4bf6c7
parent69abcd24d9ddc3490b5adeac213089318d05e4b8 (diff)
downloadRxCpp-fdee23084b7e07dce1c422049214c918dc54d170.tar.gz
doc update
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-lift.hpp11
-rw-r--r--Rx/v2/src/rxcpp/operators/rx-subscribe.hpp48
-rw-r--r--Rx/v2/src/rxcpp/rx-observable.hpp54
3 files changed, 63 insertions, 50 deletions
diff --git a/Rx/v2/src/rxcpp/operators/rx-lift.hpp b/Rx/v2/src/rxcpp/operators/rx-lift.hpp
index 4d85f77..bcbf93f 100644
--- a/Rx/v2/src/rxcpp/operators/rx-lift.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-lift.hpp
@@ -2,6 +2,17 @@
#pragma once
+/*! \file rx-lift.hpp
+
+ \brief takes any function that will take a subscriber for this observable and produce a subscriber.
+ this is intended to allow externally defined operators, that use make_subscriber, to be connected into the expression.
+
+ \tparam ResultType the type of the emitted results.
+ \tparam Operator the type of the operator.
+
+ \return An observable that emitting the items from its source.
+ */
+
#if !defined(RXCPP_OPERATORS_RX_LIFT_HPP)
#define RXCPP_OPERATORS_RX_LIFT_HPP
diff --git a/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp b/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp
index af74d2e..7488bde 100644
--- a/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp
+++ b/Rx/v2/src/rxcpp/operators/rx-subscribe.hpp
@@ -2,6 +2,54 @@
#pragma once
+/*! \file rx-subscribe.hpp
+
+ \brief Subscribe will cause the source observable to emit values to the provided subscriber.
+
+ \tparam ArgN types of the subscriber parameters
+
+ \param an the parameters for making a subscriber
+
+ \return A subscription with which the observer can stop receiving items before the observable has finished sending them.
+
+ The arguments of subscribe are forwarded to rxcpp::make_subscriber function. Some possible alternatives are:
+
+ - Pass an already composed rxcpp::subscriber:
+ \snippet subscribe.cpp subscribe by subscriber
+ \snippet output.txt subscribe by subscriber
+
+ - Pass an rxcpp::observer. This allows subscribing the same subscriber to several observables:
+ \snippet subscribe.cpp subscribe by observer
+ \snippet output.txt subscribe by observer
+
+ - Pass an `on_next` handler:
+ \snippet subscribe.cpp subscribe by on_next
+ \snippet output.txt subscribe by on_next
+
+ - Pass `on_next` and `on_error` handlers:
+ \snippet subscribe.cpp subscribe by on_next and on_error
+ \snippet output.txt subscribe by on_next and on_error
+
+ - Pass `on_next` and `on_completed` handlers:
+ \snippet subscribe.cpp subscribe by on_next and on_completed
+ \snippet output.txt subscribe by on_next and on_completed
+
+ - Pass `on_next`, `on_error`, and `on_completed` handlers:
+ \snippet subscribe.cpp subscribe by on_next, on_error, and on_completed
+ \snippet output.txt subscribe by on_next, on_error, and on_completed
+ .
+
+ All the alternatives above also support passing rxcpp::composite_subscription instance. For example:
+ \snippet subscribe.cpp subscribe by subscription, on_next, and on_completed
+ \snippet output.txt subscribe by subscription, on_next, and on_completed
+
+ If neither subscription nor subscriber are provided, then a new subscription is created and returned as a result:
+ \snippet subscribe.cpp subscribe unsubscribe
+ \snippet output.txt subscribe unsubscribe
+
+ For more details, see rxcpp::make_subscriber function description.
+*/
+
#if !defined(RXCPP_OPERATORS_RX_SUBSCRIBE_HPP)
#define RXCPP_OPERATORS_RX_SUBSCRIBE_HPP
diff --git a/Rx/v2/src/rxcpp/rx-observable.hpp b/Rx/v2/src/rxcpp/rx-observable.hpp
index 7a950c5..a22587c 100644
--- a/Rx/v2/src/rxcpp/rx-observable.hpp
+++ b/Rx/v2/src/rxcpp/rx-observable.hpp
@@ -642,11 +642,8 @@ public:
static_assert(is_operator_factory_for<this_type, OperatorFactory>::value, "Function passed for op() must have the signature Result(SourceObservable)");
}
- ///
- /// takes any function that will take a subscriber for this observable and produce a subscriber.
- /// this is intended to allow externally defined operators, that use make_subscriber, to be connected
- /// into the expression.
- ///
+ /*! @copydoc rx-lift.hpp
+ */
template<class ResultType, class Operator>
auto lift(Operator&& op) const
-> observable<rxu::value_type_t<rxo::detail::lift_operator<ResultType, source_operator_type, Operator>>, rxo::detail::lift_operator<ResultType, source_operator_type, Operator>> {
@@ -680,51 +677,8 @@ public:
}
/// \endcond
- /*! Subscribe will cause this observable to emit values to the provided subscriber.
-
- \tparam ArgN types of the subscriber parameters
-
- \param an the parameters for making a subscriber
-
- \return A subscription with which the observer can stop receiving items before the observable has finished sending them.
-
- The arguments of subscribe are forwarded to rxcpp::make_subscriber function. Some possible alternatives are:
-
- - Pass an already composed rxcpp::subscriber:
- \snippet subscribe.cpp subscribe by subscriber
- \snippet output.txt subscribe by subscriber
-
- - Pass an rxcpp::observer. This allows subscribing the same subscriber to several observables:
- \snippet subscribe.cpp subscribe by observer
- \snippet output.txt subscribe by observer
-
- - Pass an `on_next` handler:
- \snippet subscribe.cpp subscribe by on_next
- \snippet output.txt subscribe by on_next
-
- - Pass `on_next` and `on_error` handlers:
- \snippet subscribe.cpp subscribe by on_next and on_error
- \snippet output.txt subscribe by on_next and on_error
-
- - Pass `on_next` and `on_completed` handlers:
- \snippet subscribe.cpp subscribe by on_next and on_completed
- \snippet output.txt subscribe by on_next and on_completed
-
- - Pass `on_next`, `on_error`, and `on_completed` handlers:
- \snippet subscribe.cpp subscribe by on_next, on_error, and on_completed
- \snippet output.txt subscribe by on_next, on_error, and on_completed
- .
-
- All the alternatives above also support passing rxcpp::composite_subscription instance. For example:
- \snippet subscribe.cpp subscribe by subscription, on_next, and on_completed
- \snippet output.txt subscribe by subscription, on_next, and on_completed
-
- If neither subscription nor subscriber are provided, then a new subscription is created and returned as a result:
- \snippet subscribe.cpp subscribe unsubscribe
- \snippet output.txt subscribe unsubscribe
-
- For more details, see rxcpp::make_subscriber function description.
- */
+ /*! @copydoc rx-subscribe.hpp
+ */
template<class... ArgN>
auto subscribe(ArgN&&... an) const
-> composite_subscription {