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
ebc206ea
Commit
ebc206ea
authored
Oct 14, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
announce_actor_{type_impl => factory}
parent
85920019
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
libcaf_core/caf/experimental/announce_actor_type.hpp
libcaf_core/caf/experimental/announce_actor_type.hpp
+4
-4
libcaf_core/src/announce_actor_type.cpp
libcaf_core/src/announce_actor_type.cpp
+1
-1
No files found.
libcaf_core/caf/experimental/announce_actor_type.hpp
View file @
ebc206ea
...
@@ -68,7 +68,7 @@ spawn_fun make_spawn_fun(F fun) {
...
@@ -68,7 +68,7 @@ spawn_fun make_spawn_fun(F fun) {
dyn_spawn_prepare_message
<
impl
>
(
msg
,
ptr
.
get
(),
tk
);
dyn_spawn_prepare_message
<
impl
>
(
msg
,
ptr
.
get
(),
tk
);
ptr
->
initial_behavior_fac
([
=
](
local_actor
*
)
->
behavior
{
ptr
->
initial_behavior_fac
([
=
](
local_actor
*
)
->
behavior
{
auto
res
=
const_cast
<
message
&>
(
msg
).
apply
(
fun
);
auto
res
=
const_cast
<
message
&>
(
msg
).
apply
(
fun
);
if
(
res
&&
res
->
size
()
>
0
&&
res
->
template
match_element
<
behavior_t
>(
0
))
if
(
res
&&
res
->
size
()
>
0
&&
res
->
template
match_element
<
behavior_t
>(
0
))
return
std
::
move
(
res
->
template
get_as_mutable
<
behavior_t
>(
0
).
unbox
());
return
std
::
move
(
res
->
template
get_as_mutable
<
behavior_t
>(
0
).
unbox
());
return
{};
return
{};
});
});
...
@@ -106,16 +106,16 @@ spawn_fun make_spawn_fun() {
...
@@ -106,16 +106,16 @@ spawn_fun make_spawn_fun() {
actor
spawn_announce_actor_type_server
();
actor
spawn_announce_actor_type_server
();
void
announce_actor_
type_impl
(
std
::
string
&&
name
,
spawn_fun
f
);
void
announce_actor_
factory
(
std
::
string
name
,
spawn_fun
f
);
template
<
class
F
>
template
<
class
F
>
void
announce_actor_type
(
std
::
string
name
,
F
fun
)
{
void
announce_actor_type
(
std
::
string
name
,
F
fun
)
{
announce_actor_
type_impl
(
std
::
move
(
name
),
make_spawn_fun
(
fun
));
announce_actor_
factory
(
std
::
move
(
name
),
make_spawn_fun
(
fun
));
}
}
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
void
announce_actor_type
(
std
::
string
name
)
{
void
announce_actor_type
(
std
::
string
name
)
{
announce_actor_
type_impl
(
std
::
move
(
name
),
make_spawn_fun
<
T
,
Ts
...
>
());
announce_actor_
factory
(
std
::
move
(
name
),
make_spawn_fun
<
T
,
Ts
...
>
());
}
}
}
// namespace experimental
}
// namespace experimental
...
...
libcaf_core/src/announce_actor_type.cpp
View file @
ebc206ea
...
@@ -70,7 +70,7 @@ actor spawn_announce_actor_type_server() {
...
@@ -70,7 +70,7 @@ actor spawn_announce_actor_type_server() {
return
spawn
<
hidden
+
lazy_init
>
(
announce_actor_type_server
);
return
spawn
<
hidden
+
lazy_init
>
(
announce_actor_type_server
);
}
}
void
announce_actor_
type_impl
(
std
::
string
&&
name
,
spawn_fun
f
)
{
void
announce_actor_
factory
(
std
::
string
name
,
spawn_fun
f
)
{
auto
registry
=
detail
::
singletons
::
get_actor_registry
();
auto
registry
=
detail
::
singletons
::
get_actor_registry
();
auto
server
=
registry
->
get_named
(
atom
(
"SpawnServ"
));
auto
server
=
registry
->
get_named
(
atom
(
"SpawnServ"
));
anon_send
(
server
,
add_atom
::
value
,
std
::
move
(
name
),
std
::
move
(
f
));
anon_send
(
server
,
add_atom
::
value
,
std
::
move
(
name
),
std
::
move
(
f
));
...
...
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