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

Move stateful actor to namespace `caf`

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