Commit 1aeaaf81 authored by Dominik Charousset's avatar Dominik Charousset

Move stateful actor to namespace `caf`

parent 9ecec36b
......@@ -67,6 +67,7 @@
#include "caf/blocking_actor.hpp"
#include "caf/execution_unit.hpp"
#include "caf/memory_managed.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/typed_behavior.hpp"
#include "caf/actor_namespace.hpp"
#include "caf/behavior_policy.hpp"
......
......@@ -22,9 +22,9 @@
#include "caf/actor.hpp"
#include "caf/actor_addr.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/typed_behavior.hpp"
#include "caf/experimental/stateful_actor.hpp"
namespace caf {
......@@ -104,13 +104,12 @@ struct infer_handle_from_fun_impl<Result, typed_event_based_actor<Sigs...>*,
// statically typed stateful actor with self pointer
template <class Result, class State, class... Sigs>
struct infer_handle_from_fun_impl<Result,
experimental::stateful_actor<
stateful_actor<
State, typed_event_based_actor<Sigs...>
>*,
true> {
using type = typed_actor<Sigs...>;
using impl =
experimental::stateful_actor<State, typed_event_based_actor<Sigs...>>;
using impl = stateful_actor<State, typed_event_based_actor<Sigs...>>;
using behavior_type = typed_behavior<Sigs...>;
static constexpr spawn_mode mode = spawn_mode::function_with_selfptr;
};
......@@ -129,14 +128,14 @@ struct infer_handle_from_fun_impl<Result,
// statically typed stateful broker with self pointer
template <class Result, class State, class... Sigs>
struct infer_handle_from_fun_impl<Result,
experimental::stateful_actor<
stateful_actor<
State,
io::experimental::typed_broker<Sigs...>
>*,
true> {
using type = typed_actor<Sigs...>;
using impl =
experimental::stateful_actor<
stateful_actor<
State,
io::experimental::typed_broker<Sigs...>
>;
......
......@@ -17,8 +17,8 @@
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#ifndef CAF_EXPERIMENTAL_STATEFUL_ACTOR_HPP
#define CAF_EXPERIMENTAL_STATEFUL_ACTOR_HPP
#ifndef CAF_STATEFUL_ACTOR_HPP
#define CAF_STATEFUL_ACTOR_HPP
#include <new>
#include <type_traits>
......@@ -27,7 +27,6 @@
#include "caf/detail/type_traits.hpp"
namespace caf {
namespace experimental {
template <class Archive, class U>
typename std::enable_if<detail::is_serializable<U>::value>::type
......@@ -125,7 +124,6 @@ private:
union { State state_; };
};
} // namespace experimental
} // namespace caf
#endif // CAF_EXPERIMENTAL_STATEFUL_ACTOR_HPP
#endif // CAF_STATEFUL_ACTOR_HPP
......@@ -26,11 +26,10 @@
#include "caf/actor_cast.hpp"
#include "caf/replies_to.hpp"
#include "caf/abstract_actor.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/typed_behavior.hpp"
#include "caf/typed_response_promise.hpp"
#include "caf/experimental/stateful_actor.hpp"
namespace caf {
class actor_addr;
......@@ -98,21 +97,21 @@ class typed_actor : detail::comparable<typed_actor<Sigs...>>,
/// Identifies the base class for this kind of actor with actor.
template <class State>
using stateful_base = experimental::stateful_actor<State, base>;
using stateful_base = stateful_actor<State, base>;
/// Identifies the base class for this kind of actor with actor.
template <class State>
using stateful_pointer = experimental::stateful_actor<State, base>*;
using stateful_pointer = stateful_actor<State, base>*;
/// Identifies the broker_base class for this kind of actor with actor.
template <class State>
using stateful_broker_base =
experimental::stateful_actor<State, broker_base>;
stateful_actor<State, broker_base>;
/// Identifies the broker_base class for this kind of actor with actor.
template <class State>
using stateful_broker_pointer =
experimental::stateful_actor<State, broker_base>*;
stateful_actor<State, broker_base>*;
typed_actor() = default;
typed_actor(typed_actor&&) = default;
......
......@@ -32,9 +32,9 @@
#include "caf/attachable.hpp"
#include "caf/exit_reason.hpp"
#include "caf/scoped_actor.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/experimental/stateful_actor.hpp"
#include "caf/experimental/announce_actor_type.hpp"
#include "caf/scheduler/detached_threads.hpp"
......
......@@ -23,10 +23,9 @@
#include "caf/send.hpp"
#include "caf/spawn.hpp"
#include "caf/to_string.hpp"
#include "caf/stateful_actor.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/experimental/stateful_actor.hpp"
#include "caf/detail/logging.hpp"
#include "caf/detail/singletons.hpp"
#include "caf/detail/actor_registry.hpp"
......
......@@ -27,7 +27,6 @@
#include "caf/detail/actor_registry.hpp"
using namespace caf;
using namespace caf::experimental;
using std::endl;
......
......@@ -24,11 +24,8 @@
#include "caf/all.hpp"
#include "caf/experimental/stateful_actor.hpp"
using namespace std;
using namespace caf;
using namespace caf::experimental;
namespace {
......
......@@ -28,13 +28,12 @@
#include <unordered_map>
#include <unordered_set>
#include "caf/stateful_actor.hpp"
#include "caf/actor_namespace.hpp"
#include "caf/binary_serializer.hpp"
#include "caf/binary_deserializer.hpp"
#include "caf/forwarding_actor_proxy.hpp"
#include "caf/experimental/stateful_actor.hpp"
#include "caf/io/basp.hpp"
#include "caf/io/broker.hpp"
......@@ -122,7 +121,7 @@ struct basp_broker_state : actor_namespace::backend, basp::instance::callee {
};
/// A broker implementation for the Binary Actor System Protocol (BASP).
class basp_broker : public caf::experimental::stateful_actor<basp_broker_state,
class basp_broker : public caf::stateful_actor<basp_broker_state,
broker> {
public:
basp_broker(middleman& mm);
......
......@@ -27,8 +27,6 @@
#include "caf/all.hpp"
#include "caf/io/all.hpp"
#include "caf/experimental/stateful_actor.hpp"
using std::cout;
using std::cerr;
using std::endl;
......@@ -88,7 +86,7 @@ struct http_state {
abstract_broker* self_;
};
using http_broker = caf::experimental::stateful_actor<http_state, broker>;
using http_broker = caf::stateful_actor<http_state, broker>;
behavior http_worker(http_broker* self, connection_handle hdl) {
// tell network backend to receive any number of bytes between 1 and 1024
......@@ -201,7 +199,7 @@ public:
~fixture() {
anon_send_exit(aut_, exit_reason::kill);
// run the exit message and other pending messages explicitly,
// since we do not invoke any "IO" from this point on that would
// since we do not invoke any "I/O" from this point on that would
// trigger the exit message implicitly
mpx_->flush_runnables();
await_all_actors_done();
......
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