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
ac81fea9
Commit
ac81fea9
authored
May 16, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
6dd8b6c7
7c364627
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
353 additions
and
87 deletions
+353
-87
benchmarks/Distributed.scala
benchmarks/Distributed.scala
+298
-85
benchmarks/mk_scala.sh
benchmarks/mk_scala.sh
+2
-2
unit_testing/test__spawn.cpp
unit_testing/test__spawn.cpp
+53
-0
No files found.
benchmarks/Distributed.scala
View file @
ac81fea9
This diff is collapsed.
Click to expand it.
benchmarks/mk_scala.sh
View file @
ac81fea9
...
...
@@ -2,10 +2,10 @@
if
[[
$#
-eq
0
]]
;
then
for
i
in
*
.scala
;
do
echo
"compile
\"
$i
\"
"
scalac
-cp
$AKKA_LIBS
"
$i
"
scalac
-
unchecked
-
cp
$AKKA_LIBS
"
$i
"
done
elif
[[
$#
-eq
1
]]
;
then
echo
"compile
\"
$1
.scala
\"
"
scalac
-cp
$AKKA_LIBS
"
$1
.scala"
scalac
-
unchecked
-
cp
$AKKA_LIBS
"
$1
.scala"
fi
echo
done
unit_testing/test__spawn.cpp
View file @
ac81fea9
...
...
@@ -301,6 +301,41 @@ auto actor_prototype(Args const&... args) -> actor_template<decltype(mexpr_conca
return
{
mexpr_concat
(
args
...)};
}
class
str_wrapper
{
str_wrapper
()
=
delete
;
str_wrapper
(
str_wrapper
&&
)
=
delete
;
str_wrapper
(
const
str_wrapper
&
)
=
delete
;
public:
inline
str_wrapper
(
std
::
string
s
)
:
m_str
(
s
)
{
}
const
std
::
string
&
str
()
const
{
return
m_str
;
}
private:
std
::
string
m_str
;
};
bool
operator
==
(
const
str_wrapper
&
lhs
,
const
std
::
string
&
rhs
)
{
return
lhs
.
str
()
==
rhs
;
}
void
foobar
(
const
str_wrapper
&
x
,
const
std
::
string
&
y
)
{
receive
(
on
(
atom
(
"same"
)).
when
(
gref
(
x
)
==
gref
(
y
))
>>
[
&
]()
{
reply
(
atom
(
"yes"
));
},
on
(
atom
(
"same"
))
>>
[
&
]()
{
reply
(
atom
(
"no"
));
}
);
}
size_t
test__spawn
()
{
using
std
::
string
;
CPPA_TEST
(
test__spawn
);
...
...
@@ -383,6 +418,24 @@ size_t test__spawn() {
await_all_others_done
();
CPPA_IF_VERBOSE
(
cout
<<
"ok"
<<
endl
);
{
bool
invoked
=
false
;
str_wrapper
x
{
"x"
};
std
::
string
y
{
"y"
};
auto
foo_actor
=
spawn
(
foobar
,
std
::
cref
(
x
),
y
);
send
(
foo_actor
,
atom
(
"same"
));
receive
(
on
(
atom
(
"yes"
))
>>
[
&
]()
{
CPPA_ERROR
(
"x == y"
);
},
on
(
atom
(
"no"
))
>>
[
&
]()
{
invoked
=
true
;
}
);
CPPA_CHECK_EQUAL
(
true
,
invoked
);
await_all_others_done
();
}
CPPA_CHECK_EQUAL
(
behavior_test
<
testee_actor
>
(
spawn
(
testee_actor
{})),
"wait4int"
);
CPPA_CHECK_EQUAL
(
behavior_test
<
event_testee
>
(
spawn
(
new
event_testee
)),
"wait4int"
);
...
...
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