Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/rpp/rpp/disposables/callback_disposable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
#pragma once

#include <rpp/disposables/fwd.hpp>

#include <rpp/disposables/details/base_disposable.hpp>

namespace rpp
{
/**
* @brief Disposable invokes underlying callable on disposing.
*
*
* @ingroup disposables
*/
template<rpp::constraint::is_nothrow_invocable Fn>
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/disposables/composite_disposable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <atomic>
#include <memory>
#include <vector>

namespace rpp
{
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/disposables/details/base_disposable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#pragma once

#include <rpp/disposables/fwd.hpp>

#include <rpp/disposables/interface_disposable.hpp>

#include <atomic>
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/disposables/disposable_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#pragma once

#include <rpp/disposables/fwd.hpp>

#include <rpp/disposables/interface_disposable.hpp>

#include <memory>
Expand Down
2 changes: 0 additions & 2 deletions src/rpp/rpp/disposables/fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#include <rpp/utils/constraints.hpp>

#include <concepts>

namespace rpp
{
struct interface_disposable;
Expand Down
2 changes: 0 additions & 2 deletions src/rpp/rpp/disposables/interface_composite_disposable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include <rpp/disposables/disposable_wrapper.hpp>
#include <rpp/disposables/interface_disposable.hpp>

#include <memory>

namespace rpp
{
struct interface_composite_disposable : public interface_disposable
Expand Down
5 changes: 2 additions & 3 deletions src/rpp/rpp/observers/details/disposable_strategy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <rpp/disposables/disposable_wrapper.hpp>

#include <atomic>
#include <vector>

namespace rpp::details::observers
{
Expand All @@ -29,7 +28,7 @@ class atomic_bool
: m_value{other.m_value.load(std::memory_order::seq_cst)}
{}

bool test() const noexcept
bool test() const noexcept
{
// just need atomicity, not guarding anything
return m_value.load(std::memory_order::seq_cst);
Expand All @@ -50,7 +49,7 @@ class non_atomic_bool
non_atomic_bool() = default;
non_atomic_bool(non_atomic_bool&& other) noexcept = default;

bool test() const noexcept
bool test() const noexcept
{
return m_value;
}
Expand Down
2 changes: 0 additions & 2 deletions src/rpp/rpp/observers/observer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include <rpp/utils/utils.hpp>

#include <exception>
#include <stdexcept>
#include <type_traits>

namespace rpp::details
{
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/operators/combine_latest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <rpp/schedulers/current_thread.hpp>

#include <memory>
#include <tuple>

namespace rpp::operators::details
{
Expand Down
2 changes: 0 additions & 2 deletions src/rpp/rpp/operators/first.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#include <rpp/defs.hpp>
#include <rpp/operators/details/strategy.hpp>

#include <cstddef>

namespace rpp::operators::details
{
template<rpp::constraint::observer TObserver>
Expand Down
5 changes: 2 additions & 3 deletions src/rpp/rpp/operators/flat_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace rpp::operators::details
{

template<rpp::constraint::decayed_type Fn>
struct flat_map_t
{
Expand Down Expand Up @@ -58,9 +57,9 @@ namespace rpp::operators
}
*
* @details Actually it makes `map(callable)` and then `merge`.
* @details Note that flat_map merges the emissions of these Observables, so that they may interleave.
* @details Note that flat_map merges the emissions of these Observables, so that they may interleave.
*
* @param callable function that returns an observable for each item emitted by the source observable.
* @param callable function that returns an observable for each item emitted by the source observable.
* @warning #include <rpp/operators/flat_map.hpp>
*
* @ingroup transforming_operators
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/operators/last.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <rpp/defs.hpp>
#include <rpp/operators/details/strategy.hpp>

#include <cstddef>
#include <optional>

namespace rpp::operators::details
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/operators/map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <rpp/defs.hpp>
#include <rpp/operators/details/strategy.hpp>

#include <cstddef>
#include <type_traits>

namespace rpp::operators::details
Expand Down
2 changes: 0 additions & 2 deletions src/rpp/rpp/operators/merge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
#include <rpp/utils/tuple.hpp>

#include <atomic>
#include <cstddef>
#include <mutex>

namespace rpp::operators::details
{
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/operators/repeat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <rpp/utils/utils.hpp>

#include <cstddef>
#include <type_traits>

namespace rpp::operators::details
{
Expand Down
4 changes: 1 addition & 3 deletions src/rpp/rpp/operators/scan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
#include <rpp/defs.hpp>
#include <rpp/operators/details/strategy.hpp>

#include "rpp/utils/constraints.hpp"
#include "rpp/utils/utils.hpp"
#include <rpp/utils/utils.hpp>

#include <cstddef>
#include <optional>

namespace rpp::operators::details
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/operators/with_latest_from.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <rpp/schedulers/current_thread.hpp>

#include <memory>
#include <tuple>

namespace rpp::operators::details
{
Expand Down
20 changes: 9 additions & 11 deletions src/rpp/rpp/schedulers/current_thread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
#include <rpp/schedulers/details/worker.hpp>
#include <rpp/utils/functors.hpp>

#include <thread>

namespace rpp::schedulers
{
/**
Expand All @@ -34,7 +32,7 @@ namespace rpp::schedulers
* worker.schedule([&worker](const auto& handler)
* {
* std::cout << "Task 1 starts" << std::endl;
*
*
* worker.schedule([&worker](const auto& handler)
* {
* std::cout << "Task 2 starts" << std::endl;
Expand All @@ -46,13 +44,13 @@ namespace rpp::schedulers
* std::cout << "Task 2 ends" << std::endl;
* return rpp::schedulers::optional_delay_from_now{};
* }, handler);
*
*
* worker.schedule([](const auto&)
* {
* std::cout << "Task 3" << std::endl;
* return rpp::schedulers::optional_delay_from_now{};
* }, handler);
*
*
* std::cout << "Task 1 ends" << std::endl;
* return rpp::schedulers::optional_delay_from_now{};
* }, handler);
Expand All @@ -64,20 +62,20 @@ namespace rpp::schedulers
* - "Task 2 ends"
* - "Task 3"
* - "Task 4"
*
*
* @par How to use it properly?
* To have any visible impact you need to use it at least **twice** during same observable. For example, `rpp::source::just` source uses it as default scheduler as well as `rpp::operators::merge` operator (which just "owns" it during subscription).
*
* For example, this one
* \code{.cpp}
* rpp::source::just(1, 2, 3)
* | rpp::operators::merge_with(rpp::source::just(4, 5, 6))
* rpp::source::just(1, 2, 3)
* | rpp::operators::merge_with(rpp::source::just(4, 5, 6))
* | rpp::operators::subscribe([](int v) { std::cout << v << " "; });
* \endcode
* Procedes output `1 4 2 5 3 6` due to `merge_with` takes ownership over this scheduler during subscription, both sources schedule their first emissions into scheduler, then `merge_with` frees scheduler and it starts to proceed scheduled actions. As a result it continues interleaving of values. In case of usingg `rpp::schedulers::immediate` it would be:
* \code{.cpp}
* rpp::source::just(rpp::schedulers::immediate{}, 1, 2, 3)
* | rpp::operators::merge_with(rpp::source::just(rpp::schedulers::immediate{}, 4, 5, 6))
* rpp::source::just(rpp::schedulers::immediate{}, 1, 2, 3)
* | rpp::operators::merge_with(rpp::source::just(rpp::schedulers::immediate{}, 4, 5, 6))
* | rpp::operators::subscribe([](int v) { std::cout << v << " "; });
* \endcode
* With output `1 2 3 4 5 6`
Expand Down Expand Up @@ -153,7 +151,7 @@ class current_thread
if (!timepoint || handler.is_disposed())
return drain_queue(queue);
}
else
else
{
timepoint = now() + duration;
}
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/schedulers/details/queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <memory>
#include <mutex>
#include <optional>
#include <queue>
#include <utility>

namespace rpp::schedulers::details
Expand Down
2 changes: 1 addition & 1 deletion src/rpp/rpp/subjects/details/base_subject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <rpp/observables/observable.hpp>

#include "rpp/disposables/fwd.hpp"
#include <rpp/disposables/fwd.hpp>

namespace rpp::subjects::details
{
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/utils/functors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#pragma once

#include <stdexcept>
#include <tuple>

namespace rpp::utils
Expand Down
1 change: 0 additions & 1 deletion src/rpp/rpp/utils/tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <rpp/defs.hpp>
#include <rpp/utils/constraints.hpp>

#include <concepts>
#include <cstddef>
#include <utility>

Expand Down