From fdee23084b7e07dce1c422049214c918dc54d170 Mon Sep 17 00:00:00 2001 From: Grigoriy Chudnov Date: Wed, 1 Feb 2017 00:23:22 +0300 Subject: doc update --- Rx/v2/src/rxcpp/operators/rx-lift.hpp | 11 ++++++ Rx/v2/src/rxcpp/operators/rx-subscribe.hpp | 48 ++++++++++++++++++++++++++ Rx/v2/src/rxcpp/rx-observable.hpp | 54 +++--------------------------- 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::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 auto lift(Operator&& op) const -> observable>, rxo::detail::lift_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 auto subscribe(ArgN&&... an) const -> composite_subscription { -- cgit v1.2.3