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
e91d0539
Commit
e91d0539
authored
Dec 18, 2019
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include review feedback
parent
d4df45ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
13 deletions
+19
-13
libcaf_core/src/actor_system.cpp
libcaf_core/src/actor_system.cpp
+10
-7
tools/caf-run.cpp
tools/caf-run.cpp
+9
-6
No files found.
libcaf_core/src/actor_system.cpp
View file @
e91d0539
...
...
@@ -137,7 +137,8 @@ behavior config_serv_impl(stateful_actor<kvstate>* self) {
// get a 'named' actor from local registry
[
=
](
get_atom
,
atom_value
name
)
{
return
self
->
home_system
().
registry
().
get
(
name
);
}};
},
};
}
// -- spawn server -------------------------------------------------------------
...
...
@@ -154,12 +155,14 @@ const char* spawn_serv_state::name = "spawn_server";
behavior
spawn_serv_impl
(
stateful_actor
<
spawn_serv_state
>*
self
)
{
CAF_LOG_TRACE
(
""
);
return
{[
=
](
spawn_atom
,
const
std
::
string
&
name
,
message
&
args
,
return
{
[
=
](
spawn_atom
,
const
std
::
string
&
name
,
message
&
args
,
actor_system
::
mpi
&
xs
)
->
expected
<
strong_actor_ptr
>
{
CAF_LOG_TRACE
(
CAF_ARG
(
name
)
<<
CAF_ARG
(
args
));
return
self
->
system
().
spawn
<
strong_actor_ptr
>
(
name
,
std
::
move
(
args
),
self
->
context
(),
true
,
&
xs
);
}};
},
};
}
// -- stream server ------------------------------------------------------------
...
...
tools/caf-run.cpp
View file @
e91d0539
...
...
@@ -44,8 +44,12 @@ std::string encode_base64(const string& str) {
std
::
string
result
;
// consumes three characters from input
auto
consume
=
[
&
](
const
char
*
i
)
{
int
buf
[]{(
i
[
0
]
&
0xfc
)
>>
2
,
((
i
[
0
]
&
0x03
)
<<
4
)
+
((
i
[
1
]
&
0xf0
)
>>
4
),
((
i
[
1
]
&
0x0f
)
<<
2
)
+
((
i
[
2
]
&
0xc0
)
>>
6
),
i
[
2
]
&
0x3f
};
int
buf
[]{
(
i
[
0
]
&
0xfc
)
>>
2
,
((
i
[
0
]
&
0x03
)
<<
4
)
+
((
i
[
1
]
&
0xf0
)
>>
4
),
((
i
[
1
]
&
0x0f
)
<<
2
)
+
((
i
[
2
]
&
0xc0
)
>>
6
),
i
[
2
]
&
0x3f
,
};
for
(
auto
x
:
buf
)
result
+=
base64_tbl
[
x
];
};
...
...
@@ -70,7 +74,7 @@ public:
std
::
string
host
;
int
cpu_slots
;
host_desc
(
std
::
string
host_addr
,
int
slots
,
string
cldevices
)
host_desc
(
std
::
string
host_addr
,
int
slots
)
:
host
(
std
::
move
(
host_addr
)),
cpu_slots
(
slots
)
{
// nop
}
...
...
@@ -80,7 +84,7 @@ public:
host_desc
&
operator
=
(
host_desc
&&
)
=
default
;
host_desc
&
operator
=
(
const
host_desc
&
)
=
default
;
static
void
append
(
vector
<
host_desc
>&
xs
,
const
string
&
line
,
size_t
num
)
{
static
void
append
(
vector
<
host_desc
>&
xs
,
const
string
&
line
)
{
vector
<
string
>
fields
;
split
(
fields
,
line
,
is_any_of
(
" "
),
token_compress_on
);
if
(
fields
.
empty
())
...
...
@@ -99,9 +103,8 @@ std::vector<host_desc> read_hostfile(const string& fname) {
std
::
vector
<
host_desc
>
result
;
std
::
ifstream
in
{
fname
};
std
::
string
line
;
size_t
line_num
=
0
;
while
(
std
::
getline
(
in
,
line
))
host_desc
::
append
(
result
,
line
,
++
line_num
);
host_desc
::
append
(
result
,
line
);
return
result
;
}
...
...
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