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
74d4ce76
Commit
74d4ce76
authored
Jul 07, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change result of string inspector to void
parent
1770bcd7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
33 deletions
+22
-33
libcaf_core/caf/detail/stringification_inspector.hpp
libcaf_core/caf/detail/stringification_inspector.hpp
+8
-3
libcaf_core/caf/node_id.hpp
libcaf_core/caf/node_id.hpp
+12
-9
libcaf_core/test/serialization.cpp
libcaf_core/test/serialization.cpp
+2
-21
No files found.
libcaf_core/caf/detail/stringification_inspector.hpp
View file @
74d4ce76
...
@@ -45,18 +45,23 @@ namespace detail {
...
@@ -45,18 +45,23 @@ namespace detail {
class
stringification_inspector
{
class
stringification_inspector
{
public:
public:
using
result_type
=
error
;
// -- member types required by Inspector concept -----------------------------
using
result_type
=
void
;
using
is_saving
=
std
::
true_type
;
using
is_saving
=
std
::
true_type
;
// -- constructors, destructors, and assignment operators --------------------
stringification_inspector
(
std
::
string
&
result
)
:
result_
(
result
)
{
stringification_inspector
(
std
::
string
&
result
)
:
result_
(
result
)
{
// nop
// nop
}
}
// -- operator() -------------------------------------------------------------
template
<
class
...
Ts
>
template
<
class
...
Ts
>
error
operator
()(
Ts
&&
...
xs
)
{
void
operator
()(
Ts
&&
...
xs
)
{
traverse
(
std
::
forward
<
Ts
>
(
xs
)...);
traverse
(
std
::
forward
<
Ts
>
(
xs
)...);
return
none
;
}
}
private:
private:
...
...
libcaf_core/caf/node_id.hpp
View file @
74d4ce76
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "caf/meta/hex_formatted.hpp"
#include "caf/meta/hex_formatted.hpp"
#include "caf/detail/comparable.hpp"
#include "caf/detail/comparable.hpp"
#include "caf/detail/scope_guard.hpp"
#include "caf/detail/type_traits.hpp"
#include "caf/detail/type_traits.hpp"
namespace
caf
{
namespace
caf
{
...
@@ -140,15 +141,17 @@ public:
...
@@ -140,15 +141,17 @@ public:
typename
Inspector
::
result_type
>
typename
Inspector
::
result_type
>
inspect
(
Inspector
&
f
,
node_id
&
x
)
{
inspect
(
Inspector
&
f
,
node_id
&
x
)
{
data
tmp
;
data
tmp
;
auto
result
=
f
(
meta
::
type_name
(
"node_id"
),
tmp
.
pid_
,
// write changes to tmp back to x at scope exit
meta
::
hex_formatted
(),
tmp
.
host_
);
auto
sg
=
detail
::
make_scope_guard
([
&
]
{
if
(
!
tmp
.
valid
())
if
(
!
tmp
.
valid
())
x
.
data_
.
reset
();
x
.
data_
.
reset
();
else
if
(
!
x
||
!
x
.
data_
->
unique
())
else
if
(
!
x
||
!
x
.
data_
->
unique
())
x
.
data_
.
reset
(
new
data
(
tmp
));
x
.
data_
.
reset
(
new
data
(
tmp
));
else
else
*
x
.
data_
=
tmp
;
*
x
.
data_
=
tmp
;
return
result
;
});
return
f
(
meta
::
type_name
(
"node_id"
),
tmp
.
pid_
,
meta
::
hex_formatted
(),
tmp
.
host_
);
}
}
/// @endcond
/// @endcond
...
...
libcaf_core/test/serialization.cpp
View file @
74d4ce76
...
@@ -125,8 +125,8 @@ struct test_empty_non_pod {
...
@@ -125,8 +125,8 @@ struct test_empty_non_pod {
};
};
template
<
class
Inspector
>
template
<
class
Inspector
>
typename
Inspector
::
result_type
inspect
(
Inspector
&
,
test_empty_non_pod
&
)
{
typename
Inspector
::
result_type
inspect
(
Inspector
&
f
,
test_empty_non_pod
&
)
{
return
none
;
return
f
()
;
}
}
class
config
:
public
actor_system_config
{
class
config
:
public
actor_system_config
{
...
@@ -348,25 +348,6 @@ CAF_TEST(messages) {
...
@@ -348,25 +348,6 @@ CAF_TEST(messages) {
CAF_CHECK
(
is_message
(
y
).
equal
(
i32
,
te
,
str
,
rs
));
CAF_CHECK
(
is_message
(
y
).
equal
(
i32
,
te
,
str
,
rs
));
}
}
/*
CAF_TEST(actor_addr_via_message) {
auto testee = system.spawn([] {});
auto addr = actor_cast<actor_addr>(testee);
auto addr_msg = make_message(addr);
// serialize original message which uses tuple_vals and
// deserialize into a message which uses message builder
message x;
deserialize(serialize(addr_msg), x);
CAF_CHECK_EQUAL(to_string(addr_msg), to_string(x));
CAF_CHECK(is_message(x).equal(addr));
// serialize fully dynamic message again (do another roundtrip)
message y;
deserialize(serialize(x), y);
CAF_CHECK_EQUAL(to_string(addr_msg), to_string(y));
CAF_CHECK(is_message(y).equal(addr));
}
*/
CAF_TEST
(
multiple_messages
)
{
CAF_TEST
(
multiple_messages
)
{
auto
m
=
make_message
(
rs
,
te
);
auto
m
=
make_message
(
rs
,
te
);
auto
buf
=
serialize
(
te
,
m
,
msg
);
auto
buf
=
serialize
(
te
,
m
,
msg
);
...
...
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