Commit 6c50824f authored by Dominik Charousset's avatar Dominik Charousset Committed by Dominik Charousset

Move stream impl classes to detail namespace

parent 3b70a5bd
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
* http://www.boost.org/LICENSE_1_0.txt. * * http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/ ******************************************************************************/
#ifndef CAF_STREAM_SINK_IMPL_HPP #ifndef CAF_DETAIL_STREAM_SINK_IMPL_HPP
#define CAF_STREAM_SINK_IMPL_HPP #define CAF_DETAIL_STREAM_SINK_IMPL_HPP
#include "caf/config.hpp" #include "caf/config.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "caf/policy/arg.hpp" #include "caf/policy/arg.hpp"
namespace caf { namespace caf {
namespace detail {
template <class Fun, class Finalize> template <class Fun, class Finalize>
class stream_sink_impl : public stream_manager { class stream_sink_impl : public stream_manager {
...@@ -105,7 +106,7 @@ private: ...@@ -105,7 +106,7 @@ private:
}; };
template <class Init, class Fun, class Finalize> template <class Init, class Fun, class Finalize>
stream_manager_ptr make_receiving_manager(local_actor* self, Init init, Fun f, stream_manager_ptr make_stream_sink(local_actor* self, Init init, Fun f,
Finalize fin) { Finalize fin) {
using impl = stream_sink_impl<Fun, Finalize>; using impl = stream_sink_impl<Fun, Finalize>;
auto ptr = make_counted<impl>(self, std::move(f), std::move(fin)); auto ptr = make_counted<impl>(self, std::move(f), std::move(fin));
...@@ -113,6 +114,7 @@ stream_manager_ptr make_receiving_manager(local_actor* self, Init init, Fun f, ...@@ -113,6 +114,7 @@ stream_manager_ptr make_receiving_manager(local_actor* self, Init init, Fun f,
return ptr; return ptr;
} }
} // namespace detail
} // namespace caf } // namespace caf
#endif // CAF_STREAM_SINK_IMPL_HPP #endif // CAF_DETAIL_STREAM_SINK_IMPL_HPP
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
* http://www.boost.org/LICENSE_1_0.txt. * * http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/ ******************************************************************************/
#ifndef CAF_STREAM_SOURCE_IMPL_HPP #ifndef CAF_DETAIL_STREAM_SOURCE_IMPL_HPP
#define CAF_STREAM_SOURCE_IMPL_HPP #define CAF_DETAIL_STREAM_SOURCE_IMPL_HPP
#include "caf/downstream.hpp" #include "caf/downstream.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "caf/policy/arg.hpp" #include "caf/policy/arg.hpp"
namespace caf { namespace caf {
namespace detail {
template <class Fun, class Predicate, class DownstreamPolicy> template <class Fun, class Predicate, class DownstreamPolicy>
class stream_source_impl : public stream_manager { class stream_source_impl : public stream_manager {
...@@ -96,6 +97,7 @@ stream_manager_ptr make_stream_source(local_actor* self, Init init, Fun f, ...@@ -96,6 +97,7 @@ stream_manager_ptr make_stream_source(local_actor* self, Init init, Fun f,
return ptr; return ptr;
} }
} // namespace detail
} // namespace caf } // namespace caf
#endif // CAF_STREAM_SOURCE_IMPL_HPP #endif // CAF_DETAIL_STREAM_SOURCE_IMPL_HPP
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
* http://www.boost.org/LICENSE_1_0.txt. * * http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/ ******************************************************************************/
#ifndef CAF_STREAM_STAGE_IMPL_HPP #ifndef CAF_DETAIL_STREAM_STAGE_IMPL_HPP
#define CAF_STREAM_STAGE_IMPL_HPP #define CAF_DETAIL_STREAM_STAGE_IMPL_HPP
#include "caf/downstream.hpp" #include "caf/downstream.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "caf/policy/arg.hpp" #include "caf/policy/arg.hpp"
namespace caf { namespace caf {
namespace detail {
template <class Fun, class Cleanup, class DownstreamPolicy> template <class Fun, class Cleanup, class DownstreamPolicy>
class stream_stage_impl : public stream_manager { class stream_stage_impl : public stream_manager {
...@@ -89,7 +90,7 @@ public: ...@@ -89,7 +90,7 @@ public:
return sec::unexpected_message; return sec::unexpected_message;
} }
message make_output_token(const stream_id& x) const override { message make_output_token(const stream_id&) const override {
// TODO: return make_message(stream<output_type>{x}); // TODO: return make_message(stream<output_type>{x});
return make_message(); return make_message();
} }
...@@ -115,6 +116,7 @@ stream_manager_ptr make_stream_stage(local_actor* self, Init init, Fun f, ...@@ -115,6 +116,7 @@ stream_manager_ptr make_stream_stage(local_actor* self, Init init, Fun f,
return ptr; return ptr;
} }
} // namespace detail
} // namespace caf } // namespace caf
#endif // CAF_STREAM_STAGE_IMPL_HPP #endif // CAF_DETAIL_STREAM_STAGE_IMPL_HPP
...@@ -45,10 +45,7 @@ ...@@ -45,10 +45,7 @@
#include "caf/send.hpp" #include "caf/send.hpp"
#include "caf/stream_manager.hpp" #include "caf/stream_manager.hpp"
#include "caf/stream_scatterer.hpp" #include "caf/stream_scatterer.hpp"
#include "caf/stream_sink_impl.hpp"
#include "caf/stream_slot.hpp" #include "caf/stream_slot.hpp"
#include "caf/stream_source_impl.hpp"
#include "caf/stream_stage_impl.hpp"
#include "caf/system_messages.hpp" #include "caf/system_messages.hpp"
#include "caf/upstream_msg.hpp" #include "caf/upstream_msg.hpp"
#include "caf/variant.hpp" #include "caf/variant.hpp"
...@@ -66,6 +63,9 @@ ...@@ -66,6 +63,9 @@
#include "caf/intrusive/wdrr_fixed_multiplexed_queue.hpp" #include "caf/intrusive/wdrr_fixed_multiplexed_queue.hpp"
#include "caf/detail/overload.hpp" #include "caf/detail/overload.hpp"
#include "caf/detail/stream_sink_impl.hpp"
#include "caf/detail/stream_source_impl.hpp"
#include "caf/detail/stream_stage_impl.hpp"
using std::vector; using std::vector;
...@@ -300,8 +300,8 @@ public: ...@@ -300,8 +300,8 @@ public:
auto fin = [=](const int& x) { auto fin = [=](const int& x) {
return x == num_messages; return x == num_messages;
}; };
auto ptr = make_stream_source(this, init, f, fin, policy::arg<broadcast_scatterer<int>> token;
policy::arg<broadcast_scatterer<int>>::value); auto ptr = detail::make_stream_source(this, init, f, fin, token);
ptr->generate_messages(); ptr->generate_messages();
pending_managers_.emplace(slot, std::move(ptr)); pending_managers_.emplace(slot, std::move(ptr));
} }
...@@ -324,8 +324,8 @@ public: ...@@ -324,8 +324,8 @@ public:
auto cleanup = [](log_ptr&) { auto cleanup = [](log_ptr&) {
// nop // nop
}; };
forwarder = make_stream_stage(this, init, f, cleanup, policy::arg<broadcast_scatterer<int>> token;
policy::arg<broadcast_scatterer<int>>::value); forwarder = detail::make_stream_stage(this, init, f, cleanup, token);
pending_managers_.emplace(slot, forwarder); pending_managers_.emplace(slot, forwarder);
} }
...@@ -349,7 +349,7 @@ public: ...@@ -349,7 +349,7 @@ public:
auto fin = [](log_ptr&) { auto fin = [](log_ptr&) {
// nop // nop
}; };
mgr = make_receiving_manager(this, std::move(init), std::move(f), mgr = detail::make_stream_sink(this, std::move(init), std::move(f),
std::move(fin)); std::move(fin));
} }
// mgr->out().add_path(id, hs.prev_stage); // mgr->out().add_path(id, hs.prev_stage);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment