Commit 8aede249 authored by Dominik Charousset's avatar Dominik Charousset

Make is_actor_handle public

parent 227ba3ed
...@@ -650,16 +650,6 @@ struct transfer_const<const T, U> { ...@@ -650,16 +650,6 @@ struct transfer_const<const T, U> {
template <class T, class U> template <class T, class U>
using transfer_const_t = typename transfer_const<T, U>::type; using transfer_const_t = typename transfer_const<T, U>::type;
/// Checks whether `T` is an `actor` or a `typed_actor<...>`.
template <class T>
struct is_actor_handle : std::false_type {};
template <>
struct is_actor_handle<actor> : std::true_type {};
template <class... Ts>
struct is_actor_handle<typed_actor<Ts...>> : std::true_type {};
template <class T> template <class T>
struct is_stream : std::false_type {}; struct is_stream : std::false_type {};
......
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2018 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#pragma once
#include <type_traits>
#include "caf/fwd.hpp"
namespace caf {
/// Checks whether `T` is an `actor` or a `typed_actor<...>`.
template <class T>
struct is_actor_handle : std::false_type {};
template <>
struct is_actor_handle<actor> : std::true_type {};
template <class... Ts>
struct is_actor_handle<typed_actor<Ts...>> : std::true_type {};
} // namespace caf
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "caf/fwd.hpp" #include "caf/fwd.hpp"
#include "caf/inbound_path.hpp" #include "caf/inbound_path.hpp"
#include "caf/invoke_message_result.hpp" #include "caf/invoke_message_result.hpp"
#include "caf/is_actor_handle.hpp"
#include "caf/local_actor.hpp" #include "caf/local_actor.hpp"
#include "caf/logger.hpp" #include "caf/logger.hpp"
#include "caf/make_sink_result.hpp" #include "caf/make_sink_result.hpp"
...@@ -461,7 +462,7 @@ public: ...@@ -461,7 +462,7 @@ public:
template <class Init, class Pull, class Done, class Finalize = unit_t, template <class Init, class Pull, class Done, class Finalize = unit_t,
class DownstreamManager = default_downstream_manager_t<Pull>, class DownstreamManager = default_downstream_manager_t<Pull>,
class Trait = stream_source_trait_t<Pull>> class Trait = stream_source_trait_t<Pull>>
detail::enable_if_t<!detail::is_actor_handle<Init>::value && Trait::valid, detail::enable_if_t<!is_actor_handle<Init>::value && Trait::valid,
make_source_result_t<DownstreamManager>> make_source_result_t<DownstreamManager>>
make_source(Init init, Pull pull, Done done, Finalize finalize = {}, make_source(Init init, Pull pull, Done done, Finalize finalize = {},
policy::arg<DownstreamManager> token = {}) { policy::arg<DownstreamManager> token = {}) {
...@@ -474,7 +475,7 @@ public: ...@@ -474,7 +475,7 @@ public:
class Finalize = unit_t, class Finalize = unit_t,
class DownstreamManager = default_downstream_manager_t<Pull>, class DownstreamManager = default_downstream_manager_t<Pull>,
class Trait = stream_source_trait_t<Pull>> class Trait = stream_source_trait_t<Pull>>
detail::enable_if_t<detail::is_actor_handle<ActorHandle>::value, detail::enable_if_t<is_actor_handle<ActorHandle>::value,
make_source_result_t<DownstreamManager>> make_source_result_t<DownstreamManager>>
make_source(const ActorHandle& dest, std::tuple<Ts...> xs, Init init, make_source(const ActorHandle& dest, std::tuple<Ts...> xs, Init init,
Pull pull, Done done, Finalize fin = {}, Pull pull, Done done, Finalize fin = {},
...@@ -495,7 +496,7 @@ public: ...@@ -495,7 +496,7 @@ public:
class Finalize = unit_t, class Finalize = unit_t,
class DownstreamManager = default_downstream_manager_t<Pull>, class DownstreamManager = default_downstream_manager_t<Pull>,
class Trait = stream_source_trait_t<Pull>> class Trait = stream_source_trait_t<Pull>>
detail::enable_if_t<detail::is_actor_handle<ActorHandle>::value && Trait::valid, detail::enable_if_t<is_actor_handle<ActorHandle>::value && Trait::valid,
make_source_result_t<DownstreamManager>> make_source_result_t<DownstreamManager>>
make_source(const ActorHandle& dest, Init init, Pull pull, Done done, make_source(const ActorHandle& dest, Init init, Pull pull, Done done,
Finalize fin = {}, Finalize fin = {},
......
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