Commit 3f66a8d1 authored by Dominik Charousset's avatar Dominik Charousset

fsm_actor => sb_actor

parent ae4ceb4b
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "utility.hpp" #include "utility.hpp"
#include "cppa/cppa.hpp" #include "cppa/cppa.hpp"
#include "cppa/fsm_actor.hpp" #include "cppa/sb_actor.hpp"
using std::cout; using std::cout;
using std::cerr; using std::cerr;
...@@ -44,7 +44,7 @@ using std::uint32_t; ...@@ -44,7 +44,7 @@ using std::uint32_t;
using namespace cppa; using namespace cppa;
struct testee : fsm_actor<testee> { struct testee : sb_actor<testee> {
actor_ptr parent; actor_ptr parent;
behavior init_state; behavior init_state;
testee(const actor_ptr& pptr) : parent(pptr) { testee(const actor_ptr& pptr) : parent(pptr) {
......
...@@ -107,7 +107,7 @@ class actor_template { ...@@ -107,7 +107,7 @@ class actor_template {
actor_template(MatchExpr me) : m_expr(std::move(me)) { } actor_template(MatchExpr me) : m_expr(std::move(me)) { }
actor_ptr spawn() const { actor_ptr spawn() const {
struct impl : fsm_actor<impl> { struct impl : sb_actor<impl> {
behavior init_state; behavior init_state;
impl(const MatchExpr& mx) : init_state(mx.as_partial_function()) { impl(const MatchExpr& mx) : init_state(mx.as_partial_function()) {
} }
...@@ -122,7 +122,7 @@ auto actor_prototype(const Args&... args) -> actor_template<decltype(mexpr_conca ...@@ -122,7 +122,7 @@ auto actor_prototype(const Args&... args) -> actor_template<decltype(mexpr_conca
return {mexpr_concat(args...)}; return {mexpr_concat(args...)};
} }
struct ping_actor : fsm_actor<ping_actor> { struct ping_actor : sb_actor<ping_actor> {
behavior init_state; behavior init_state;
actor_ptr parent; actor_ptr parent;
...@@ -156,7 +156,7 @@ struct ping_actor : fsm_actor<ping_actor> { ...@@ -156,7 +156,7 @@ struct ping_actor : fsm_actor<ping_actor> {
}; };
struct server_actor : fsm_actor<server_actor> { struct server_actor : sb_actor<server_actor> {
typedef std::map<std::pair<string, uint16_t>, actor_ptr> pong_map; typedef std::map<std::pair<string, uint16_t>, actor_ptr> pong_map;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#include "utility.hpp" #include "utility.hpp"
#include "cppa/cppa.hpp" #include "cppa/cppa.hpp"
#include "cppa/fsm_actor.hpp" #include "cppa/sb_actor.hpp"
using std::cout; using std::cout;
using std::cerr; using std::cerr;
...@@ -45,7 +45,7 @@ using std::int64_t; ...@@ -45,7 +45,7 @@ using std::int64_t;
using namespace cppa; using namespace cppa;
struct fsm_receiver : fsm_actor<fsm_receiver> { struct fsm_receiver : sb_actor<fsm_receiver> {
int64_t m_value; int64_t m_value;
behavior init_state; behavior init_state;
fsm_receiver(int64_t max) : m_value(0) { fsm_receiver(int64_t max) : m_value(0) {
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "cppa/cppa.hpp" #include "cppa/cppa.hpp"
#include "cppa/match.hpp" #include "cppa/match.hpp"
#include "cppa/fsm_actor.hpp" #include "cppa/sb_actor.hpp"
#include "cppa/detail/mock_scheduler.hpp" #include "cppa/detail/mock_scheduler.hpp"
#include "cppa/context_switching_actor.hpp" #include "cppa/context_switching_actor.hpp"
...@@ -64,7 +64,7 @@ void check_factors(const factors& vec) { ...@@ -64,7 +64,7 @@ void check_factors(const factors& vec) {
# endif # endif
} }
struct fsm_worker : fsm_actor<fsm_worker> { struct fsm_worker : sb_actor<fsm_worker> {
actor_ptr mc; actor_ptr mc;
behavior init_state; behavior init_state;
fsm_worker(const actor_ptr& msgcollector) : mc(msgcollector) { fsm_worker(const actor_ptr& msgcollector) : mc(msgcollector) {
...@@ -79,7 +79,7 @@ struct fsm_worker : fsm_actor<fsm_worker> { ...@@ -79,7 +79,7 @@ struct fsm_worker : fsm_actor<fsm_worker> {
} }
}; };
struct fsm_chain_link : fsm_actor<fsm_chain_link> { struct fsm_chain_link : sb_actor<fsm_chain_link> {
actor_ptr next; actor_ptr next;
behavior init_state; behavior init_state;
fsm_chain_link(const actor_ptr& n) : next(n) { fsm_chain_link(const actor_ptr& n) : next(n) {
...@@ -92,7 +92,7 @@ struct fsm_chain_link : fsm_actor<fsm_chain_link> { ...@@ -92,7 +92,7 @@ struct fsm_chain_link : fsm_actor<fsm_chain_link> {
} }
}; };
struct fsm_chain_master : fsm_actor<fsm_chain_master> { struct fsm_chain_master : sb_actor<fsm_chain_master> {
int iteration; int iteration;
actor_ptr mc; actor_ptr mc;
actor_ptr next; actor_ptr next;
...@@ -132,7 +132,7 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master> { ...@@ -132,7 +132,7 @@ struct fsm_chain_master : fsm_actor<fsm_chain_master> {
} }
}; };
struct fsm_supervisor : fsm_actor<fsm_supervisor> { struct fsm_supervisor : sb_actor<fsm_supervisor> {
int left; int left;
behavior init_state; behavior init_state;
fsm_supervisor(int num_msgs) : left(num_msgs) { fsm_supervisor(int num_msgs) : left(num_msgs) {
......
...@@ -96,7 +96,7 @@ cppa/either.hpp ...@@ -96,7 +96,7 @@ cppa/either.hpp
cppa/exception.hpp cppa/exception.hpp
cppa/exit_reason.hpp cppa/exit_reason.hpp
cppa/from_string.hpp cppa/from_string.hpp
cppa/fsm_actor.hpp cppa/sb_actor.hpp
cppa/get.hpp cppa/get.hpp
cppa/group.hpp cppa/group.hpp
cppa/guard_expr.hpp cppa/guard_expr.hpp
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include "cppa/scheduler.hpp" #include "cppa/scheduler.hpp"
#include "cppa/to_string.hpp" #include "cppa/to_string.hpp"
#include "cppa/any_tuple.hpp" #include "cppa/any_tuple.hpp"
#include "cppa/fsm_actor.hpp" #include "cppa/sb_actor.hpp"
#include "cppa/cow_tuple.hpp" #include "cppa/cow_tuple.hpp"
#include "cppa/exit_reason.hpp" #include "cppa/exit_reason.hpp"
#include "cppa/local_actor.hpp" #include "cppa/local_actor.hpp"
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
namespace cppa { namespace cppa {
/** /**
* @brief A base class for event-based actors using the * @brief A base class for state-based actors using the
* Curiously Recurring Template Pattern * Curiously Recurring Template Pattern
* to initialize the derived actor with its @p init_state member. * to initialize the derived actor with its @p init_state member.
* @tparam Derived Subclass of fsm_actor. * @tparam Derived Direct subclass of @p sb_actor.
*/ */
template<class Derived> template<class Derived>
class fsm_actor : public event_based_actor { class sb_actor : public event_based_actor {
public: public:
......
...@@ -12,7 +12,7 @@ using std::chrono::seconds; ...@@ -12,7 +12,7 @@ using std::chrono::seconds;
using namespace cppa; using namespace cppa;
// either taken by a philosopher or available // either taken by a philosopher or available
struct chopstick : fsm_actor<chopstick> { struct chopstick : sb_actor<chopstick> {
behavior& init_state; // a reference to available behavior& init_state; // a reference to available
behavior available; behavior available;
...@@ -73,7 +73,7 @@ struct chopstick : fsm_actor<chopstick> { ...@@ -73,7 +73,7 @@ struct chopstick : fsm_actor<chopstick> {
* [ X = right => Y = left ] * [ X = right => Y = left ]
*/ */
struct philosopher : fsm_actor<philosopher> { struct philosopher : sb_actor<philosopher> {
std::string name; // the name of this philosopher std::string name; // the name of this philosopher
actor_ptr left; // left chopstick actor_ptr left; // left chopstick
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#include "ping_pong.hpp" #include "ping_pong.hpp"
#include "cppa/cppa.hpp" #include "cppa/cppa.hpp"
#include "cppa/fsm_actor.hpp" #include "cppa/sb_actor.hpp"
#include "cppa/to_string.hpp" #include "cppa/to_string.hpp"
namespace { size_t s_pongs = 0; } namespace { size_t s_pongs = 0; }
...@@ -40,7 +40,7 @@ void ping(size_t num_pings) { ...@@ -40,7 +40,7 @@ void ping(size_t num_pings) {
actor_ptr spawn_event_based_ping(size_t num_pings) { actor_ptr spawn_event_based_ping(size_t num_pings) {
s_pongs = 0; s_pongs = 0;
struct impl : public fsm_actor<impl> { struct impl : public sb_actor<impl> {
behavior init_state; behavior init_state;
impl(size_t num_pings) { impl(size_t num_pings) {
init_state = ( init_state = (
...@@ -85,7 +85,7 @@ void pong(actor_ptr ping_actor) { ...@@ -85,7 +85,7 @@ void pong(actor_ptr ping_actor) {
actor_ptr spawn_event_based_pong(actor_ptr ping_actor) { actor_ptr spawn_event_based_pong(actor_ptr ping_actor) {
CPPA_REQUIRE(ping_actor.get() != nullptr); CPPA_REQUIRE(ping_actor.get() != nullptr);
struct impl : public fsm_actor<impl> { struct impl : public sb_actor<impl> {
behavior init_state; behavior init_state;
impl() { impl() {
init_state = ( init_state = (
......
...@@ -79,7 +79,7 @@ __<Fun> get__(Fun f) { ...@@ -79,7 +79,7 @@ __<Fun> get__(Fun f) {
return {f}; return {f};
} }
struct fobaz : fsm_actor<fobaz> { struct fobaz : sb_actor<fobaz> {
behavior init_state; behavior init_state;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "cppa/actor.hpp" #include "cppa/actor.hpp"
#include "cppa/factory.hpp" #include "cppa/factory.hpp"
#include "cppa/scheduler.hpp" #include "cppa/scheduler.hpp"
#include "cppa/fsm_actor.hpp" #include "cppa/sb_actor.hpp"
#include "cppa/to_string.hpp" #include "cppa/to_string.hpp"
#include "cppa/exit_reason.hpp" #include "cppa/exit_reason.hpp"
#include "cppa/event_based_actor.hpp" #include "cppa/event_based_actor.hpp"
...@@ -27,7 +27,7 @@ using namespace cppa; ...@@ -27,7 +27,7 @@ using namespace cppa;
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 7) #if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 7)
struct simple_mirror : fsm_actor<simple_mirror> { struct simple_mirror : sb_actor<simple_mirror> {
behavior init_state = ( behavior init_state = (
others() >> []() { others() >> []() {
...@@ -91,9 +91,9 @@ struct event_testee : public fsm_actor<event_testee> { ...@@ -91,9 +91,9 @@ struct event_testee : public fsm_actor<event_testee> {
#else #else
class event_testee : public fsm_actor<event_testee> { class event_testee : public sb_actor<event_testee> {
friend class fsm_actor<event_testee>; friend class sb_actor<event_testee>;
behavior wait4string; behavior wait4string;
behavior wait4float; behavior wait4float;
...@@ -138,7 +138,7 @@ class event_testee : public fsm_actor<event_testee> { ...@@ -138,7 +138,7 @@ class event_testee : public fsm_actor<event_testee> {
// quits after 5 timeouts // quits after 5 timeouts
event_based_actor* event_testee2() { event_based_actor* event_testee2() {
struct impl : fsm_actor<impl> { struct impl : sb_actor<impl> {
behavior wait4timeout(int remaining) { behavior wait4timeout(int remaining) {
return ( return (
after(std::chrono::milliseconds(50)) >> [=]() { after(std::chrono::milliseconds(50)) >> [=]() {
...@@ -155,7 +155,7 @@ event_based_actor* event_testee2() { ...@@ -155,7 +155,7 @@ event_based_actor* event_testee2() {
return new impl; return new impl;
} }
struct chopstick : public fsm_actor<chopstick> { struct chopstick : public sb_actor<chopstick> {
behavior taken_by(actor_ptr hakker) { behavior taken_by(actor_ptr hakker) {
return ( return (
......
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