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
07ef8117
Commit
07ef8117
authored
Jul 27, 2012
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented forward_to
parent
88dbe4a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
cppa/cppa.hpp
cppa/cppa.hpp
+4
-0
cppa/local_actor.hpp
cppa/local_actor.hpp
+2
-0
src/local_actor.cpp
src/local_actor.cpp
+16
-0
No files found.
cppa/cppa.hpp
View file @
07ef8117
...
@@ -506,6 +506,10 @@ inline void reply(Args&&... what) {
...
@@ -506,6 +506,10 @@ inline void reply(Args&&... what) {
self
->
reply_message
(
make_any_tuple
(
std
::
forward
<
Args
>
(
what
)...));
self
->
reply_message
(
make_any_tuple
(
std
::
forward
<
Args
>
(
what
)...));
}
}
inline
void
forward_to
(
const
actor_ptr
&
whom
)
{
self
->
forward_message
(
whom
);
}
/**
/**
* @brief Sends a message to @p whom that is delayed by @p rel_time.
* @brief Sends a message to @p whom that is delayed by @p rel_time.
* @param whom Receiver of the message.
* @param whom Receiver of the message.
...
...
cppa/local_actor.hpp
View file @
07ef8117
...
@@ -388,6 +388,8 @@ class local_actor : public actor {
...
@@ -388,6 +388,8 @@ class local_actor : public actor {
void
reply_message
(
any_tuple
&&
what
);
void
reply_message
(
any_tuple
&&
what
);
void
forward_message
(
const
actor_ptr
&
new_receiver
);
inline
actor_ptr
&
chained_actor
()
{
inline
actor_ptr
&
chained_actor
()
{
return
m_chained_actor
;
return
m_chained_actor
;
}
}
...
...
src/local_actor.cpp
View file @
07ef8117
...
@@ -119,4 +119,20 @@ void local_actor::reply_message(any_tuple&& what) {
...
@@ -119,4 +119,20 @@ void local_actor::reply_message(any_tuple&& what) {
else
whom
->
sync_enqueue
(
this
,
id
.
response_id
(),
std
::
move
(
what
));
else
whom
->
sync_enqueue
(
this
,
id
.
response_id
(),
std
::
move
(
what
));
}
}
void
local_actor
::
forward_message
(
const
actor_ptr
&
new_receiver
)
{
if
(
new_receiver
==
nullptr
)
{
return
;
}
auto
&
from
=
last_sender
();
auto
id
=
m_current_node
->
mid
;
if
(
id
.
valid
()
==
false
||
id
.
is_response
())
{
new_receiver
->
enqueue
(
from
.
get
(),
m_current_node
->
msg
);
}
else
{
new_receiver
->
sync_enqueue
(
from
.
get
(),
id
,
m_current_node
->
msg
);
// treat this message as asynchronous message from now on
m_current_node
->
mid
=
message_id_t
();
}
}
}
// namespace cppa
}
// namespace cppa
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