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
6fb0dd04
Commit
6fb0dd04
authored
Aug 09, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initialize reference members using non-static member initialization
parent
d39fdefc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+14
-13
No files found.
unit_testing/test__spawn.cpp
View file @
6fb0dd04
...
@@ -39,11 +39,11 @@ class event_testee : public sb_actor<event_testee> {
...
@@ -39,11 +39,11 @@ class event_testee : public sb_actor<event_testee> {
behavior
wait4float
;
behavior
wait4float
;
behavior
wait4int
;
behavior
wait4int
;
behavior
&
init_state
;
behavior
&
init_state
=
wait4int
;
public:
public:
event_testee
()
:
init_state
(
wait4int
)
{
event_testee
()
{
wait4string
=
(
wait4string
=
(
on
<
std
::
string
>
()
>>
[
=
]()
{
on
<
std
::
string
>
()
>>
[
=
]()
{
become
(
wait4int
);
become
(
wait4int
);
...
@@ -95,13 +95,13 @@ actor_ptr spawn_event_testee2() {
...
@@ -95,13 +95,13 @@ actor_ptr spawn_event_testee2() {
struct
chopstick
:
public
sb_actor
<
chopstick
>
{
struct
chopstick
:
public
sb_actor
<
chopstick
>
{
behavior
taken_by
(
actor_ptr
hakker
)
{
behavior
taken_by
(
actor_ptr
whom
)
{
return
(
return
(
on
<
atom
(
"take"
)
>
()
>>
[
=
]()
{
on
<
atom
(
"take"
)
>
()
>>
[
=
]()
{
reply
(
atom
(
"busy"
));
reply
(
atom
(
"busy"
));
},
},
on
(
atom
(
"put"
),
hakker
)
>>
[
=
]()
{
on
(
atom
(
"put"
),
whom
)
>>
[
=
]()
{
become
(
init_stat
e
);
become
(
availabl
e
);
},
},
on
(
atom
(
"break"
))
>>
[
=
]()
{
on
(
atom
(
"break"
))
>>
[
=
]()
{
quit
();
quit
();
...
@@ -109,18 +109,18 @@ struct chopstick : public sb_actor<chopstick> {
...
@@ -109,18 +109,18 @@ struct chopstick : public sb_actor<chopstick> {
);
);
}
}
behavior
init_state
;
behavior
available
;
behavior
&
init_state
=
available
;
chopstick
()
{
chopstick
()
{
init_stat
e
=
(
availabl
e
=
(
on
(
atom
(
"take"
),
arg_match
)
>>
[
=
](
actor_ptr
hakker
)
{
on
(
atom
(
"take"
),
arg_match
)
>>
[
=
](
actor_ptr
whom
)
{
become
(
taken_by
(
hakker
));
become
(
taken_by
(
whom
));
reply
(
atom
(
"taken"
));
reply
(
atom
(
"taken"
));
},
},
on
(
atom
(
"break"
))
>>
[
=
]()
{
on
(
atom
(
"break"
))
>>
[
=
]()
{
quit
();
quit
();
},
others
()
>>
[
=
]()
{
}
}
);
);
}
}
...
@@ -251,11 +251,12 @@ class fixed_stack : public sb_actor<fixed_stack> {
...
@@ -251,11 +251,12 @@ class fixed_stack : public sb_actor<fixed_stack> {
behavior
full
;
behavior
full
;
behavior
filled
;
behavior
filled
;
behavior
empty
;
behavior
empty
;
behavior
&
init_state
;
behavior
&
init_state
=
empty
;
public:
public:
fixed_stack
(
size_t
max
)
:
max_size
(
max
)
,
init_state
(
empty
)
{
fixed_stack
(
size_t
max
)
:
max_size
(
max
)
{
full
=
(
full
=
(
on
(
atom
(
"push"
),
arg_match
)
>>
[
=
](
int
)
{
},
on
(
atom
(
"push"
),
arg_match
)
>>
[
=
](
int
)
{
},
...
...
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