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
dae1de64
Commit
dae1de64
authored
Sep 25, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow typed actors to use `aout`
parent
1f0e3c52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
examples/brokers/simple_broker.cpp
examples/brokers/simple_broker.cpp
+2
-2
libcaf_core/caf/actor_ostream.hpp
libcaf_core/caf/actor_ostream.hpp
+4
-3
libcaf_core/src/actor_ostream.cpp
libcaf_core/src/actor_ostream.cpp
+8
-0
No files found.
examples/brokers/simple_broker.cpp
View file @
dae1de64
...
@@ -39,8 +39,8 @@ using pong_atom = atom_constant<atom("pong")>;
...
@@ -39,8 +39,8 @@ using pong_atom = atom_constant<atom("pong")>;
using
kickoff_atom
=
atom_constant
<
atom
(
"kickoff"
)
>
;
using
kickoff_atom
=
atom_constant
<
atom
(
"kickoff"
)
>
;
// utility function to print an exit message with custom name
// utility function to print an exit message with custom name
void
print_on_exit
(
const
actor
&
ptr
,
const
std
::
string
&
name
)
{
void
print_on_exit
(
const
actor
&
hdl
,
const
std
::
string
&
name
)
{
ptr
->
attach_functor
([
=
](
uint32_t
reason
)
{
hdl
->
attach_functor
([
=
](
abstract_actor
*
ptr
,
uint32_t
reason
)
{
aout
(
ptr
)
<<
name
<<
" exited with reason "
<<
reason
<<
endl
;
aout
(
ptr
)
<<
name
<<
" exited with reason "
<<
reason
<<
endl
;
});
});
}
}
...
...
libcaf_core/caf/actor_ostream.hpp
View file @
dae1de64
...
@@ -94,9 +94,10 @@ private:
...
@@ -94,9 +94,10 @@ private:
};
};
/// Convenience factory function for creating an actor output stream.
/// Convenience factory function for creating an actor output stream.
inline
actor_ostream
aout
(
actor
self
)
{
actor_ostream
aout
(
const
scoped_actor
&
self
);
return
actor_ostream
{
self
};
}
/// Convenience factory function for creating an actor output stream.
actor_ostream
aout
(
abstract_actor
*
self
);
}
// namespace caf
}
// namespace caf
...
...
libcaf_core/src/actor_ostream.cpp
View file @
dae1de64
...
@@ -55,6 +55,14 @@ void actor_ostream::redirect_all(std::string f, int flags) {
...
@@ -55,6 +55,14 @@ void actor_ostream::redirect_all(std::string f, int flags) {
redirect_atom
::
value
,
std
::
move
(
f
),
flags
);
redirect_atom
::
value
,
std
::
move
(
f
),
flags
);
}
}
actor_ostream
aout
(
const
scoped_actor
&
self
)
{
return
actor_ostream
{
self
};
}
actor_ostream
aout
(
abstract_actor
*
self
)
{
return
actor_ostream
{
actor_cast
<
actor
>
(
intrusive_ptr
<
abstract_actor
>
{
self
})};
}
}
// namespace caf
}
// namespace caf
namespace
std
{
namespace
std
{
...
...
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