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
2b2cf282
Commit
2b2cf282
authored
Jul 25, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed compiler switches and use portable features only
parent
9cfda04a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
141 deletions
+0
-141
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+0
-141
No files found.
unit_testing/test__spawn.cpp
View file @
2b2cf282
...
...
@@ -25,8 +25,6 @@ using std::endl;
using
namespace
cppa
;
#if (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 7)
struct
simple_mirror
:
sb_actor
<
simple_mirror
>
{
behavior
init_state
=
(
...
...
@@ -37,60 +35,6 @@ struct simple_mirror : sb_actor<simple_mirror> {
};
#else
struct
simple_mirror
:
event_based_actor
{
void
init
()
{
become
(
others
()
>>
[]()
{
self
->
last_sender
()
<<
self
->
last_dequeued
();
}
);
}
};
#endif
// GCC 4.7 supports non-static member initialization
#if 0 //(__GNUC__ >= 4) && (__GNUC_MINOR__ >= 7)
struct event_testee : public fsm_actor<event_testee> {
behavior wait4string = (
on<std::string>() >> [=]() {
become(wait4int);
},
on<atom("get_state")>() >> [=]() {
reply("wait4string");
}
);
behavior wait4float = (
on<float>() >> [=]() {
become(wait4string);
},
on<atom("get_state")>() >> [=]() {
reply("wait4float");
}
);
behavior wait4int = (
on<int>() >> [=]() {
become(wait4float);
},
on<atom("get_state")>() >> [=]() {
reply("wait4int");
}
);
behavior& init_state = wait4int;
};
#else
class
event_testee
:
public
sb_actor
<
event_testee
>
{
friend
class
sb_actor
<
event_testee
>
;
...
...
@@ -134,8 +78,6 @@ class event_testee : public sb_actor<event_testee> {
};
#endif
// quits after 5 timeouts
actor_ptr
spawn_event_testee2
()
{
struct
impl
:
sb_actor
<
impl
>
{
...
...
@@ -302,56 +244,6 @@ std::string behavior_test(actor_ptr et) {
return
result
;
}
#ifdef __clang__
class
fixed_stack
:
public
sb_actor
<
fixed_stack
>
{
friend
class
sb_actor
<
fixed_stack
>
;
size_t
max_size
;
std
::
vector
<
int
>
data
;
behavior
full
=
(
on
(
atom
(
"push"
),
arg_match
)
>>
[
=
](
int
)
{
},
on
(
atom
(
"pop"
))
>>
[
=
]()
{
reply
(
atom
(
"ok"
),
data
.
back
());
data
.
pop_back
();
become
(
filled
);
}
);
behavior
filled
=
(
on
(
atom
(
"push"
),
arg_match
)
>>
[
=
](
int
what
)
{
data
.
push_back
(
what
);
if
(
data
.
size
()
==
max_size
)
become
(
full
);
},
on
(
atom
(
"pop"
))
>>
[
=
]()
{
reply
(
atom
(
"ok"
),
data
.
back
());
data
.
pop_back
();
if
(
data
.
empty
())
become
(
empty
);
}
);
behavior
empty
=
(
on
(
atom
(
"push"
),
arg_match
)
>>
[
=
](
int
what
)
{
data
.
push_back
(
what
);
become
(
filled
);
},
on
(
atom
(
"pop"
))
>>
[
=
]()
{
reply
(
atom
(
"failure"
));
}
);
behavior
&
init_state
=
empty
;
public:
fixed_stack
(
size_t
max
)
:
max_size
(
max
)
{
}
};
#else
class
fixed_stack
:
public
sb_actor
<
fixed_stack
>
{
friend
class
sb_actor
<
fixed_stack
>
;
...
...
@@ -405,7 +297,6 @@ class fixed_stack : public sb_actor<fixed_stack> {
}
};
#endif
int
main
()
{
using
std
::
string
;
...
...
@@ -820,36 +711,4 @@ int main() {
// verify pong messages
CPPA_CHECK_EQUAL
(
10
,
pongs
());
return
CPPA_TEST_RESULT
;
/****** TODO
int add_fun(int, int);
int sub_fun(int, int);
...
class math {
public:
int add_fun(int, int);
int sub_fun(int, int);
};
...
auto factory1 = actor_prototype (
on<atom("add"), int, int>().reply_with(atom("result"), add_fun),
on<atom("sub"), int, int>().reply_with(atom("result"), add_fun)
);
auto a1 = factory1.spawn();
...
auto factory2 = actor_facade<math> (
on<atom("add"), int, int>().reply_with(atom("result"), &math::add_fun), <-- possible?
on<atom("sub"), int, int>().reply_with(atom("result"), &math::sub_fun)
);
auto a2 = factory2.spawn();
*/
}
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