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
d67d10b2
Commit
d67d10b2
authored
Aug 23, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more consistent coding style
parent
7bc8b9ce
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
benchmarks/cppa/actor_creation.cpp
benchmarks/cppa/actor_creation.cpp
+12
-13
No files found.
benchmarks/cppa/actor_creation.cpp
View file @
d67d10b2
...
@@ -41,22 +41,21 @@ using namespace std;
...
@@ -41,22 +41,21 @@ using namespace std;
using
namespace
cppa
;
using
namespace
cppa
;
struct
testee
:
sb_actor
<
testee
>
{
struct
testee
:
sb_actor
<
testee
>
{
actor_ptr
parent
;
behavior
init_state
;
behavior
init_state
;
testee
(
const
actor_ptr
&
p
ptr
)
:
parent
(
pptr
)
{
testee
(
const
actor_ptr
&
p
arent
)
{
init_state
=
(
init_state
=
(
on
(
atom
(
"spread"
),
unsigned
(
0
)
)
>>
[
=
]()
{
on
(
atom
(
"spread"
),
(
uint32_t
)
0
)
>>
[
=
]()
{
send
(
parent
,
atom
(
"result"
),
(
uint32_t
)
1
);
send
(
parent
,
atom
(
"result"
),
(
uint32_t
)
1
);
quit
();
quit
();
},
},
on
(
atom
(
"spread"
),
arg_match
)
>>
[
=
](
u
nsigned
x
)
{
on
(
atom
(
"spread"
),
arg_match
)
>>
[
=
](
u
int32_t
x
)
{
any_tuple
msg
=
make_cow_tuple
(
atom
(
"spread"
),
x
-
1
);
any_tuple
msg
=
make_cow_tuple
(
atom
(
"spread"
),
x
-
1
);
spawn
<
testee
>
(
this
)
<<
msg
;
spawn
<
testee
>
(
this
)
<<
msg
;
spawn
<
testee
>
(
this
)
<<
msg
;
spawn
<
testee
>
(
this
)
<<
msg
;
become
(
become
(
on
<
atom
(
"result"
),
uint32_t
>
(
)
>>
[
=
](
uint32_t
r1
)
{
on
(
atom
(
"result"
),
arg_match
)
>>
[
=
](
uint32_t
r1
)
{
become
(
become
(
on
<
atom
(
"result"
),
uint32_t
>
(
)
>>
[
=
](
uint32_t
r2
)
{
on
(
atom
(
"result"
),
arg_match
)
>>
[
=
](
uint32_t
r2
)
{
send
(
parent
,
atom
(
"result"
),
r1
+
r2
);
send
(
parent
,
atom
(
"result"
),
r1
+
r2
);
quit
();
quit
();
}
}
...
@@ -70,17 +69,17 @@ struct testee : sb_actor<testee> {
...
@@ -70,17 +69,17 @@ struct testee : sb_actor<testee> {
void
stacked_testee
(
actor_ptr
parent
)
{
void
stacked_testee
(
actor_ptr
parent
)
{
receive
(
receive
(
on
(
atom
(
"spread"
),
unsigned
(
0
)
)
>>
[
&
]()
{
on
(
atom
(
"spread"
),
(
uint32_t
)
0
)
>>
[
&
]()
{
send
(
parent
,
atom
(
"result"
),
(
uint32_t
)
1
);
send
(
parent
,
atom
(
"result"
),
(
uint32_t
)
1
);
},
},
on
<
atom
(
"spread"
),
unsigned
>
()
>>
[
&
](
unsigned
x
)
{
on
(
atom
(
"spread"
),
arg_match
)
>>
[
&
](
uint32_t
x
)
{
any_tuple
msg
=
make_cow_tuple
(
atom
(
"spread"
),
x
-
1
);
any_tuple
msg
=
make_cow_tuple
(
atom
(
"spread"
),
x
-
1
);
spawn
(
stacked_testee
,
self
)
<<
msg
;
spawn
(
stacked_testee
,
self
)
<<
msg
;
spawn
(
stacked_testee
,
self
)
<<
msg
;
spawn
(
stacked_testee
,
self
)
<<
msg
;
receive
(
receive
(
on
<
atom
(
"result"
),
uint32_t
>
(
)
>>
[
&
](
uint32_t
v1
)
{
on
(
atom
(
"result"
),
arg_match
)
>>
[
&
](
uint32_t
v1
)
{
receive
(
receive
(
on
<
atom
(
"result"
),
uint32_t
>
(
)
>>
[
&
](
uint32_t
v2
)
{
on
(
atom
(
"result"
),
arg_match
)
>>
[
&
](
uint32_t
v2
)
{
send
(
parent
,
atom
(
"result"
),
v1
+
v2
);
send
(
parent
,
atom
(
"result"
),
v1
+
v2
);
}
}
);
);
...
@@ -99,10 +98,10 @@ void usage() {
...
@@ -99,10 +98,10 @@ void usage() {
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
vector
<
string
>
args
(
argv
+
1
,
argv
+
argc
);
vector
<
string
>
args
(
argv
+
1
,
argv
+
argc
);
match
(
args
)
(
match
(
args
)
(
on
(
"stacked"
,
spro
<
u
nsigned
>
)
>>
[](
unsigned
num
)
{
on
(
"stacked"
,
spro
<
u
int32_t
>
)
>>
[](
uint32_t
num
)
{
send
(
spawn
(
stacked_testee
,
self
),
atom
(
"spread"
),
num
);
send
(
spawn
(
stacked_testee
,
self
),
atom
(
"spread"
),
num
);
},
},
on
(
"event-based"
,
spro
<
u
nsigned
>
)
>>
[](
unsigned
num
)
{
on
(
"event-based"
,
spro
<
u
int32_t
>
)
>>
[](
uint32_t
num
)
{
send
(
spawn
<
testee
>
(
self
),
atom
(
"spread"
),
num
);
send
(
spawn
<
testee
>
(
self
),
atom
(
"spread"
),
num
);
},
},
others
()
>>
usage
others
()
>>
usage
...
...
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