Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
3f66a8d1
Commit
3f66a8d1
authored
Jun 25, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fsm_actor => sb_actor
parent
ae4ceb4b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
29 additions
and
29 deletions
+29
-29
benchmarks/actor_creation.cpp
benchmarks/actor_creation.cpp
+2
-2
benchmarks/distributed.cpp
benchmarks/distributed.cpp
+3
-3
benchmarks/mailbox_performance.cpp
benchmarks/mailbox_performance.cpp
+2
-2
benchmarks/mixed_case.cpp
benchmarks/mixed_case.cpp
+5
-5
cppa.files
cppa.files
+1
-1
cppa/cppa.hpp
cppa/cppa.hpp
+1
-1
cppa/sb_actor.hpp
cppa/sb_actor.hpp
+3
-3
examples/dining_philosophers.cpp
examples/dining_philosophers.cpp
+2
-2
unit_testing/ping_pong.cpp
unit_testing/ping_pong.cpp
+3
-3
unit_testing/test__match.cpp
unit_testing/test__match.cpp
+1
-1
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+6
-6
No files found.
benchmarks/actor_creation.cpp
View file @
3f66a8d1
...
@@ -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
)
{
...
...
benchmarks/distributed.cpp
View file @
3f66a8d1
...
@@ -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
;
...
...
benchmarks/mailbox_performance.cpp
View file @
3f66a8d1
...
@@ -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
)
{
...
...
benchmarks/mixed_case.cpp
View file @
3f66a8d1
...
@@ -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
)
{
...
...
cppa.files
View file @
3f66a8d1
...
@@ -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
...
...
cppa/cppa.hpp
View file @
3f66a8d1
...
@@ -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"
...
...
cppa/
fsm
_actor.hpp
→
cppa/
sb
_actor.hpp
View file @
3f66a8d1
...
@@ -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:
...
...
examples/dining_philosophers.cpp
View file @
3f66a8d1
...
@@ -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
...
...
unit_testing/ping_pong.cpp
View file @
3f66a8d1
...
@@ -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
=
(
...
...
unit_testing/test__match.cpp
View file @
3f66a8d1
...
@@ -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
;
...
...
unit_testing/test__spawn.cpp
View file @
3f66a8d1
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment