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
a1798bcb
Commit
a1798bcb
authored
Sep 25, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add net::middleman module to the actor system
parent
aa4b49d3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
0 deletions
+31
-0
libcaf_core/caf/actor_system.hpp
libcaf_core/caf/actor_system.hpp
+9
-0
libcaf_core/caf/fwd.hpp
libcaf_core/caf/fwd.hpp
+8
-0
libcaf_core/src/actor_system.cpp
libcaf_core/src/actor_system.cpp
+13
-0
libcaf_test/caf/test/dsl.hpp
libcaf_test/caf/test/dsl.hpp
+1
-0
No files found.
libcaf_core/caf/actor_system.hpp
View file @
a1798bcb
...
@@ -117,6 +117,7 @@ class actor_system {
...
@@ -117,6 +117,7 @@ class actor_system {
public:
public:
friend
class
logger
;
friend
class
logger
;
friend
class
io
::
middleman
;
friend
class
io
::
middleman
;
friend
class
net
::
middleman
;
friend
class
abstract_actor
;
friend
class
abstract_actor
;
/// The number of actors implictly spawned by the actor system on startup.
/// The number of actors implictly spawned by the actor system on startup.
...
@@ -151,6 +152,7 @@ public:
...
@@ -151,6 +152,7 @@ public:
middleman
,
middleman
,
opencl_manager
,
opencl_manager
,
openssl_manager
,
openssl_manager
,
network_manager
,
num_ids
num_ids
};
};
...
@@ -279,6 +281,13 @@ public:
...
@@ -279,6 +281,13 @@ public:
/// @throws `std::logic_error` if module is not loaded.
/// @throws `std::logic_error` if module is not loaded.
openssl
::
manager
&
openssl_manager
()
const
;
openssl
::
manager
&
openssl_manager
()
const
;
/// Returns `true` if the network module is available, `false` otherwise.
bool
has_network_manager
()
const
noexcept
;
/// Returns the network manager (middleman) instance.
/// @throws `std::logic_error` if module is not loaded.
net
::
middleman
&
network_manager
();
/// Returns a dummy execution unit that forwards
/// Returns a dummy execution unit that forwards
/// everything to the scheduler.
/// everything to the scheduler.
scoped_execution_unit
*
dummy_execution_unit
();
scoped_execution_unit
*
dummy_execution_unit
();
...
...
libcaf_core/caf/fwd.hpp
View file @
a1798bcb
...
@@ -223,6 +223,14 @@ struct header;
...
@@ -223,6 +223,14 @@ struct header;
}
// namespace io
}
// namespace io
// -- networking classes -------------------------------------------------------
namespace
net
{
class
middleman
;
}
// namespace net
// -- OpenCL classes -----------------------------------------------------------
// -- OpenCL classes -----------------------------------------------------------
namespace
opencl
{
namespace
opencl
{
...
...
libcaf_core/src/actor_system.cpp
View file @
a1798bcb
...
@@ -208,6 +208,8 @@ const char* actor_system::module::name() const noexcept {
...
@@ -208,6 +208,8 @@ const char* actor_system::module::name() const noexcept {
return
"OpenCL Manager"
;
return
"OpenCL Manager"
;
case
openssl_manager
:
case
openssl_manager
:
return
"OpenSSL Manager"
;
return
"OpenSSL Manager"
;
case
network_manager
:
return
"Network Manager"
;
default:
default:
return
"???"
;
return
"???"
;
}
}
...
@@ -408,6 +410,17 @@ openssl::manager& actor_system::openssl_manager() const {
...
@@ -408,6 +410,17 @@ openssl::manager& actor_system::openssl_manager() const {
return
*
reinterpret_cast
<
openssl
::
manager
*>
(
clptr
->
subtype_ptr
());
return
*
reinterpret_cast
<
openssl
::
manager
*>
(
clptr
->
subtype_ptr
());
}
}
bool
actor_system
::
has_network_manager
()
const
noexcept
{
return
modules_
[
module
::
network_manager
]
!=
nullptr
;
}
net
::
middleman
&
actor_system
::
network_manager
()
{
auto
&
clptr
=
modules_
[
module
::
network_manager
];
if
(
!
clptr
)
CAF_RAISE_ERROR
(
"cannot access openssl manager: module not loaded"
);
return
*
reinterpret_cast
<
net
::
middleman
*>
(
clptr
->
subtype_ptr
());
}
scoped_execution_unit
*
actor_system
::
dummy_execution_unit
()
{
scoped_execution_unit
*
actor_system
::
dummy_execution_unit
()
{
return
&
dummy_execution_unit_
;
return
&
dummy_execution_unit_
;
}
}
...
...
libcaf_test/caf/test/dsl.hpp
View file @
a1798bcb
...
@@ -639,6 +639,7 @@ public:
...
@@ -639,6 +639,7 @@ public:
cfg
.
set
(
"logger.inline-output"
,
true
);
cfg
.
set
(
"logger.inline-output"
,
true
);
cfg
.
set
(
"logger.file-verbosity"
,
caf
::
atom
(
"quiet"
));
cfg
.
set
(
"logger.file-verbosity"
,
caf
::
atom
(
"quiet"
));
cfg
.
set
(
"middleman.network-backend"
,
caf
::
atom
(
"testing"
));
cfg
.
set
(
"middleman.network-backend"
,
caf
::
atom
(
"testing"
));
cfg
.
set
(
"middleman.manual-multiplexing"
,
true
);
cfg
.
set
(
"middleman.workers"
,
size_t
{
0
});
cfg
.
set
(
"middleman.workers"
,
size_t
{
0
});
return
cfg
;
return
cfg
;
}
}
...
...
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