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
217c2f50
Commit
217c2f50
authored
Mar 14, 2016
by
Matthias Vallentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify generic serialization parameter naming
parent
20047855
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
138 additions
and
137 deletions
+138
-137
libcaf_core/caf/detail/delegate_serialize.hpp
libcaf_core/caf/detail/delegate_serialize.hpp
+3
-3
libcaf_core/caf/detail/try_serialize.hpp
libcaf_core/caf/detail/try_serialize.hpp
+5
-5
libcaf_core/caf/detail/tuple_vals.hpp
libcaf_core/caf/detail/tuple_vals.hpp
+6
-6
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+4
-4
libcaf_core/caf/duration.hpp
libcaf_core/caf/duration.hpp
+4
-4
libcaf_core/caf/index_mapping.hpp
libcaf_core/caf/index_mapping.hpp
+3
-3
libcaf_core/caf/maybe.hpp
libcaf_core/caf/maybe.hpp
+6
-6
libcaf_core/caf/message.hpp
libcaf_core/caf/message.hpp
+2
-2
libcaf_core/caf/none.hpp
libcaf_core/caf/none.hpp
+2
-2
libcaf_core/caf/system_messages.hpp
libcaf_core/caf/system_messages.hpp
+10
-10
libcaf_core/caf/type_erased_value.hpp
libcaf_core/caf/type_erased_value.hpp
+9
-9
libcaf_core/caf/typed_actor.hpp
libcaf_core/caf/typed_actor.hpp
+6
-6
libcaf_core/caf/unit.hpp
libcaf_core/caf/unit.hpp
+2
-2
libcaf_core/src/actor_registry.cpp
libcaf_core/src/actor_registry.cpp
+4
-4
libcaf_core/test/local_migration.cpp
libcaf_core/test/local_migration.cpp
+3
-3
libcaf_core/test/message.cpp
libcaf_core/test/message.cpp
+9
-9
libcaf_core/test/serialization.cpp
libcaf_core/test/serialization.cpp
+15
-15
libcaf_core/test/typed_spawn.cpp
libcaf_core/test/typed_spawn.cpp
+4
-4
libcaf_io/caf/io/accept_handle.hpp
libcaf_io/caf/io/accept_handle.hpp
+3
-3
libcaf_io/caf/io/basp/header.hpp
libcaf_io/caf/io/basp/header.hpp
+9
-9
libcaf_io/caf/io/connection_handle.hpp
libcaf_io/caf/io/connection_handle.hpp
+4
-3
libcaf_io/caf/io/system_messages.hpp
libcaf_io/caf/io/system_messages.hpp
+19
-19
libcaf_io/test/typed_remote_actor.cpp
libcaf_io/test/typed_remote_actor.cpp
+6
-6
No files found.
libcaf_core/caf/detail/delegate_serialize.hpp
View file @
217c2f50
...
...
@@ -51,10 +51,10 @@ namespace detail {
// Calls `serialize(...)` with `using namespace boost::serialization`
// to enable both ADL and picking up existing boost code.
template
<
class
T
,
class
U
>
void
delegate_serialize
(
T
&
in_or_out
,
U
&
x
)
{
template
<
class
Processor
,
class
U
>
void
delegate_serialize
(
Processor
&
proc
,
U
&
x
)
{
using
namespace
boost
::
serialization
;
serialize
(
in_or_out
,
x
,
0
);
serialize
(
proc
,
x
,
0
);
}
}
// namespace detail
...
...
libcaf_core/caf/detail/try_serialize.hpp
View file @
217c2f50
...
...
@@ -23,13 +23,13 @@
namespace
caf
{
namespace
detail
{
template
<
class
T
,
class
U
>
auto
try_serialize
(
T
&
in_or_out
,
U
*
x
)
->
decltype
(
in_or_out
&
*
x
)
{
in_or_out
&
*
x
;
template
<
class
Processor
,
class
U
>
auto
try_serialize
(
Processor
&
proc
,
U
*
x
)
->
decltype
(
proc
&
*
x
)
{
proc
&
*
x
;
}
template
<
class
T
>
void
try_serialize
(
T
&
,
const
void
*
)
{
template
<
class
Processor
>
void
try_serialize
(
Processor
&
,
const
void
*
)
{
// nop
}
...
...
libcaf_core/caf/detail/tuple_vals.hpp
View file @
217c2f50
...
...
@@ -57,12 +57,12 @@ struct tup_ptr_access {
return
tup_ptr_access
<
Pos
+
1
,
Max
>::
cmp
(
pos
,
tup
,
x
);
}
template
<
class
T
,
class
U
>
static
void
serialize
(
size_t
pos
,
T
&
tup
,
U
&
in_or_out
)
{
template
<
class
T
,
class
Processor
>
static
void
serialize
(
size_t
pos
,
T
&
tup
,
Processor
&
proc
)
{
if
(
pos
==
Pos
)
try_serialize
(
in_or_out
,
&
std
::
get
<
Pos
>
(
tup
));
try_serialize
(
proc
,
&
std
::
get
<
Pos
>
(
tup
));
else
tup_ptr_access
<
Pos
+
1
,
Max
>::
serialize
(
pos
,
tup
,
in_or_out
);
tup_ptr_access
<
Pos
+
1
,
Max
>::
serialize
(
pos
,
tup
,
proc
);
}
template
<
class
T
>
...
...
@@ -91,8 +91,8 @@ struct tup_ptr_access<Pos, Max, false> {
return
false
;
}
template
<
class
T
,
class
U
>
static
void
serialize
(
size_t
,
T
&
,
U
&
)
{
template
<
class
T
,
class
Processor
>
static
void
serialize
(
size_t
,
T
&
,
Processor
&
)
{
// end of recursion
}
...
...
libcaf_core/caf/detail/type_traits.hpp
View file @
217c2f50
...
...
@@ -259,7 +259,7 @@ template <class F, class S>
struct
is_tuple
<
std
::
pair
<
F
,
S
>>
:
std
::
true_type
{
};
/// Checks whether `T` provides a free
/// `serialize(
InOut
&, T&, const unsigned int)` function.
/// `serialize(
Processor
&, T&, const unsigned int)` function.
template
<
class
T
>
struct
has_free_serialize
{
private:
...
...
@@ -284,7 +284,7 @@ public:
};
/// Checks whether `T` provides a member
/// `T::serialize(
InOut
&, const unsigned int)` function.
/// `T::serialize(
Processor
&, const unsigned int)` function.
template
<
class
T
>
struct
has_member_serialize
{
private:
...
...
@@ -309,8 +309,8 @@ public:
};
/// Checks whether `T` provides either a free function
/// `serialize(
InOut
&, T&, const unsigned int)` or a member function
/// `T::serialize(
InOut
&, const unsigned int)`. If `T` is iterable,
/// `serialize(
Processor
&, T&, const unsigned int)` or a member function
/// `T::serialize(
Processor
&, const unsigned int)`. If `T` is iterable,
/// then the template checks whether `T::value_type` is serializable.
template
<
class
T
,
bool
Ignore
=
std
::
is_pointer
<
T
>
::
value
...
...
libcaf_core/caf/duration.hpp
View file @
217c2f50
...
...
@@ -126,10 +126,10 @@ private:
};
/// @relates duration
template
<
class
T
>
void
serialize
(
T
&
in_out
,
duration
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
unit
;
in_out
&
x
.
count
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
duration
&
x
,
const
unsigned
int
)
{
proc
&
x
.
unit
;
proc
&
x
.
count
;
}
/// @relates duration
...
...
libcaf_core/caf/index_mapping.hpp
View file @
217c2f50
...
...
@@ -49,9 +49,9 @@ inline bool operator==(const index_mapping& x, const index_mapping& y) {
return
x
.
value
==
y
.
value
;
}
template
<
class
T
>
void
serialize
(
T
&
in_or_out
,
index_mapping
&
x
,
const
unsigned
int
)
{
in_or_out
&
x
.
value
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
index_mapping
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
}
inline
std
::
string
to_string
(
const
index_mapping
&
x
)
{
...
...
libcaf_core/caf/maybe.hpp
View file @
217c2f50
...
...
@@ -637,9 +637,9 @@ bool operator!=(const none_t&, const maybe<T>& x) {
}
/// @relates maybe
template
<
class
InOrOut
,
class
T
>
typename
std
::
enable_if
<
InOrOut
::
is_saving
::
value
>::
type
serialize
(
InOrOut
&
sink
,
maybe
<
T
>&
x
,
const
unsigned
int
)
{
template
<
class
Processor
,
class
T
>
typename
std
::
enable_if
<
Processor
::
is_saving
::
value
>::
type
serialize
(
Processor
&
sink
,
maybe
<
T
>&
x
,
const
unsigned
int
)
{
uint8_t
flag
=
x
.
empty
()
?
0
:
(
x
.
valid
()
?
1
:
2
);
sink
&
flag
;
if
(
x
.
valid
())
...
...
@@ -651,9 +651,9 @@ serialize(InOrOut& sink, maybe<T>& x, const unsigned int) {
}
/// @relates maybe
template
<
class
InOrOut
,
class
T
>
typename
std
::
enable_if
<
InOrOut
::
is_loading
::
value
>::
type
serialize
(
InOrOut
&
source
,
maybe
<
T
>&
x
,
const
unsigned
int
)
{
template
<
class
Processor
,
class
T
>
typename
std
::
enable_if
<
Processor
::
is_loading
::
value
>::
type
serialize
(
Processor
&
source
,
maybe
<
T
>&
x
,
const
unsigned
int
)
{
uint8_t
flag
;
source
&
flag
;
switch
(
flag
)
{
...
...
libcaf_core/caf/message.hpp
View file @
217c2f50
...
...
@@ -414,8 +414,8 @@ make_message(T&& x, Ts&&... xs) {
>
;
static_assert
(
tl_forall
<
stored_types
,
is_serializable_or_whitelisted
>::
value
,
"at least one type is not serializable via free "
"'serialize(
InOrOut
&, T&, const unsigned int)' or "
"`T::serialize(
InOrOut
&, const unsigned int)` "
"'serialize(
Processor
&, T&, const unsigned int)' or "
"`T::serialize(
Processor
&, const unsigned int)` "
"member function; you can whitelist individual types by "
"specializing `caf::allowed_unsafe_message_type<T>` "
"or using the macro CAF_ALLOW_UNSAFE_MESSAGE_TYPE"
);
...
...
libcaf_core/caf/none.hpp
View file @
217c2f50
...
...
@@ -43,8 +43,8 @@ struct none_t : detail::comparable<none_t> {
static
constexpr
none_t
none
=
none_t
{};
/// @relates none_t
template
<
class
T
>
void
serialize
(
T
&
,
const
none_t
&
,
const
unsigned
int
)
{
template
<
class
Processor
>
void
serialize
(
Processor
&
,
const
none_t
&
,
const
unsigned
int
)
{
// nop
}
...
...
libcaf_core/caf/system_messages.hpp
View file @
217c2f50
...
...
@@ -84,7 +84,7 @@ operator!=(const T& lhs, const T& rhs) {
return
!
(
lhs
==
rhs
);
}
template
<
class
IO
,
class
T
>
template
<
class
Processor
,
class
T
>
typename
std
::
enable_if
<
detail
::
tl_exists
<
detail
::
type_list
<
exit_msg
,
down_msg
>
,
...
...
@@ -94,9 +94,9 @@ typename std::enable_if<
>::
template
type
>
::
value
>::
type
serialize
(
IO
&
in_or_out
,
T
&
x
,
const
unsigned
int
)
{
in_or_out
&
x
.
source
;
in_or_out
&
x
.
reason
;
serialize
(
Processor
&
proc
,
T
&
x
,
const
unsigned
int
)
{
proc
&
x
.
source
;
proc
&
x
.
reason
;
}
/// Sent to all members of a group when it goes offline.
...
...
@@ -120,9 +120,9 @@ inline bool operator!=(const group_down_msg& lhs, const group_down_msg& rhs) {
}
/// @relates group_down_msg
template
<
class
IO
>
void
serialize
(
IO
&
in_or_out
,
group_down_msg
&
x
,
const
unsigned
int
)
{
in_or_out
&
x
.
source
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
group_down_msg
&
x
,
const
unsigned
int
)
{
proc
&
x
.
source
;
}
/// Sent whenever a timeout occurs during a synchronous send.
...
...
@@ -166,9 +166,9 @@ inline bool operator!=(const timeout_msg& lhs, const timeout_msg& rhs) {
}
/// @relates timeout_msg
template
<
class
IO
>
void
serialize
(
IO
&
in_or_out
,
timeout_msg
&
x
,
const
unsigned
int
)
{
in_or_out
&
x
.
timeout_id
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
timeout_msg
&
x
,
const
unsigned
int
)
{
proc
&
x
.
timeout_id
;
}
}
// namespace caf
...
...
libcaf_core/caf/type_erased_value.hpp
View file @
217c2f50
...
...
@@ -193,22 +193,22 @@ struct type_erased_value_impl<T[N]> : public type_erased_value {
array_copy_impl
(
lhs
,
rhs
,
token
);
}
template
<
class
A
,
class
U
,
size_t
Len
>
static
void
array_serialize_impl
(
A
&
in_out
,
U
(
&
ys
)[
Len
],
std
::
true_type
)
{
template
<
class
P
,
class
U
,
size_t
Len
>
static
void
array_serialize_impl
(
P
&
proc
,
U
(
&
ys
)[
Len
],
std
::
true_type
)
{
for
(
auto
&
y
:
ys
)
array_serialize
(
in_out
,
y
);
array_serialize
(
proc
,
y
);
}
template
<
class
A
,
class
U
,
size_t
Len
>
static
void
array_serialize_impl
(
A
&
in_out
,
U
(
&
ys
)[
Len
],
std
::
false_type
)
{
template
<
class
P
,
class
U
,
size_t
Len
>
static
void
array_serialize_impl
(
P
&
proc
,
U
(
&
ys
)[
Len
],
std
::
false_type
)
{
for
(
auto
&
y
:
ys
)
in_out
&
y
;
proc
&
y
;
}
template
<
class
A
,
class
U
,
size_t
Len
>
static
void
array_serialize
(
A
&
in_out
,
U
(
&
ys
)[
Len
])
{
template
<
class
P
,
class
U
,
size_t
Len
>
static
void
array_serialize
(
P
&
proc
,
U
(
&
ys
)[
Len
])
{
std
::
integral_constant
<
bool
,
std
::
is_array
<
U
>::
value
>
token
;
array_serialize_impl
(
in_out
,
ys
,
token
);
array_serialize_impl
(
proc
,
ys
,
token
);
}
};
...
...
libcaf_core/caf/typed_actor.hpp
View file @
217c2f50
...
...
@@ -330,17 +330,17 @@ splice(const typed_actor<Xs...>& x, const Ts&... xs) {
}
/// @relates typed_actor
template
<
class
T
,
class
...
Ts
>
typename
std
::
enable_if
<
T
::
is_saving
::
value
>::
type
serialize
(
T
&
sink
,
typed_actor
<
Ts
...
>&
hdl
,
const
unsigned
int
)
{
template
<
class
Processor
,
class
...
Ts
>
typename
std
::
enable_if
<
Processor
::
is_saving
::
value
>::
type
serialize
(
Processor
&
sink
,
typed_actor
<
Ts
...
>&
hdl
,
const
unsigned
int
)
{
auto
addr
=
hdl
.
address
();
sink
<<
addr
;
}
/// @relates typed_actor
template
<
class
T
,
class
...
Ts
>
typename
std
::
enable_if
<
T
::
is_loading
::
value
>::
type
serialize
(
T
&
sink
,
typed_actor
<
Ts
...
>&
hdl
,
const
unsigned
int
)
{
template
<
class
Processor
,
class
...
Ts
>
typename
std
::
enable_if
<
Processor
::
is_loading
::
value
>::
type
serialize
(
Processor
&
sink
,
typed_actor
<
Ts
...
>&
hdl
,
const
unsigned
int
)
{
actor_addr
addr
;
sink
>>
addr
;
hdl
=
actor_cast
<
typed_actor
<
Ts
...
>>
(
addr
);
...
...
libcaf_core/caf/unit.hpp
View file @
217c2f50
...
...
@@ -51,8 +51,8 @@ struct unit_t : detail::comparable<unit_t> {
static
constexpr
unit_t
unit
=
unit_t
{};
/// @relates unit_t
template
<
class
T
>
void
serialize
(
T
&
,
const
unit_t
&
,
const
unsigned
int
)
{
template
<
class
Processor
>
void
serialize
(
Processor
&
,
const
unit_t
&
,
const
unsigned
int
)
{
// nop
}
...
...
libcaf_core/src/actor_registry.cpp
View file @
217c2f50
...
...
@@ -161,10 +161,10 @@ struct kvstate {
std
::
unordered_map
<
key_type
,
std
::
pair
<
mapped_type
,
subscriber_set
>>
data
;
std
::
unordered_map
<
actor
,
topic_set
>
subscribers
;
const
char
*
name
=
"caf.config_server"
;
template
<
class
T
>
friend
void
serialize
(
T
&
in_out
,
kvstate
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
data
;
in_out
&
x
.
subscribers
;
template
<
class
Processor
>
friend
void
serialize
(
Processor
&
proc
,
kvstate
&
x
,
const
unsigned
int
)
{
proc
&
x
.
data
;
proc
&
x
.
subscribers
;
}
};
}
// namespace <anonymous>
...
...
libcaf_core/test/local_migration.cpp
View file @
217c2f50
...
...
@@ -39,9 +39,9 @@ struct migratable_state {
const
char
*
migratable_state
::
name
=
"migratable_actor"
;
template
<
class
Archive
>
void
serialize
(
Archive
&
ar
,
migratable_state
&
x
,
const
unsigned
int
)
{
ar
&
x
.
value
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
migratable_state
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
}
struct
migratable_actor
:
stateful_actor
<
migratable_state
>
{
...
...
libcaf_core/test/message.cpp
View file @
217c2f50
...
...
@@ -175,9 +175,9 @@ bool operator==(const s1& lhs, const s1& rhs) {
return
true
;
}
template
<
class
T
>
void
serialize
(
T
&
in_out
,
s1
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
value
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
s1
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
}
std
::
string
to_string
(
const
s1
&
x
)
{
...
...
@@ -196,9 +196,9 @@ bool operator==(const s2& lhs, const s2& rhs) {
return
true
;
}
template
<
class
T
>
void
serialize
(
T
&
in_out
,
s2
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
value
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
s2
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
}
std
::
string
to_string
(
const
s2
&
x
)
{
...
...
@@ -216,9 +216,9 @@ bool operator==(const s3& lhs, const s3& rhs) {
return
lhs
.
value
==
rhs
.
value
;
}
template
<
class
T
>
void
serialize
(
T
&
in_out
,
s3
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
value
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
s3
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
}
std
::
string
to_string
(
const
s3
&
x
)
{
...
...
libcaf_core/test/serialization.cpp
View file @
217c2f50
...
...
@@ -73,9 +73,9 @@ struct raw_struct {
string
str
;
};
template
<
class
T
>
void
serialize
(
T
&
in_out
,
raw_struct
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
str
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
raw_struct
&
x
,
const
unsigned
int
)
{
proc
&
x
.
str
;
}
bool
operator
==
(
const
raw_struct
&
lhs
,
const
raw_struct
&
rhs
)
{
...
...
@@ -102,10 +102,10 @@ struct test_array {
int
value2
[
2
][
4
];
};
template
<
class
T
>
void
serialize
(
T
&
in_out
,
test_array
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
value
;
in_out
&
x
.
value2
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
test_array
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
proc
&
x
.
value2
;
}
bool
operator
==
(
const
test_array
&
lhs
,
const
test_array
&
rhs
)
{
...
...
@@ -128,8 +128,8 @@ struct test_empty_non_pod {
}
};
template
<
class
T
>
void
serialize
(
T
&
,
test_empty_non_pod
&
,
const
unsigned
int
)
{
template
<
class
Processor
>
void
serialize
(
Processor
&
,
test_empty_non_pod
&
,
const
unsigned
int
)
{
// nop
}
...
...
@@ -152,15 +152,15 @@ struct fixture {
scoped_execution_unit
context
;
message
msg
;
template
<
class
IO
>
void
apply
(
IO
&
)
{
template
<
class
Processor
>
void
apply
(
Processor
&
)
{
// end of recursion
}
template
<
class
IO
,
class
T
,
class
...
Ts
>
void
apply
(
IO
&
in_out
,
T
&
x
,
Ts
&
...
xs
)
{
in_out
&
x
;
apply
(
in_out
,
xs
...);
template
<
class
Processor
,
class
T
,
class
...
Ts
>
void
apply
(
Processor
&
proc
,
T
&
x
,
Ts
&
...
xs
)
{
proc
&
x
;
apply
(
proc
,
xs
...);
}
template
<
class
T
,
class
...
Ts
>
...
...
libcaf_core/test/typed_spawn.cpp
View file @
217c2f50
...
...
@@ -81,10 +81,10 @@ struct my_request {
int
b
;
};
template
<
class
T
>
void
serialize
(
T
&
in_out
,
my_request
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
a
;
in_out
&
x
.
b
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
my_request
&
x
,
const
unsigned
int
)
{
proc
&
x
.
a
;
proc
&
x
.
b
;
}
using
server_type
=
typed_actor
<
replies_to
<
my_request
>::
with
<
bool
>>
;
...
...
libcaf_io/caf/io/accept_handle.hpp
View file @
217c2f50
...
...
@@ -49,9 +49,9 @@ public:
// nop
}
template
<
class
T
>
friend
void
serialize
(
T
&
in_out
,
accept_handle
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
id_
;
template
<
class
Procesor
>
friend
void
serialize
(
Procesor
&
proc
,
accept_handle
&
x
,
const
unsigned
int
)
{
proc
&
x
.
id_
;
}
private:
...
...
libcaf_io/caf/io/basp/header.hpp
View file @
217c2f50
...
...
@@ -48,15 +48,15 @@ struct header {
};
/// @relates header
template
<
class
T
>
void
serialize
(
T
&
in_or_out
,
header
&
hdr
,
const
unsigned
int
)
{
in_or_out
&
hdr
.
source_node
;
in_or_out
&
hdr
.
dest_node
;
in_or_out
&
hdr
.
source_actor
;
in_or_out
&
hdr
.
dest_actor
;
in_or_out
&
hdr
.
payload_len
;
in_or_out
&
hdr
.
operation
;
in_or_out
&
hdr
.
operation_data
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
header
&
hdr
,
const
unsigned
int
)
{
proc
&
hdr
.
source_node
;
proc
&
hdr
.
dest_node
;
proc
&
hdr
.
source_actor
;
proc
&
hdr
.
dest_actor
;
proc
&
hdr
.
payload_len
;
proc
&
hdr
.
operation
;
proc
&
hdr
.
operation_data
;
}
/// @relates header
...
...
libcaf_io/caf/io/connection_handle.hpp
View file @
217c2f50
...
...
@@ -52,9 +52,10 @@ public:
// nop
}
template
<
class
T
>
friend
void
serialize
(
T
&
in_out
,
connection_handle
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
id_
;
template
<
class
Processor
>
friend
void
serialize
(
Processor
&
proc
,
connection_handle
&
x
,
const
unsigned
int
)
{
proc
&
x
.
id_
;
}
private:
...
...
libcaf_io/caf/io/system_messages.hpp
View file @
217c2f50
...
...
@@ -59,10 +59,10 @@ inline bool operator!=(const new_connection_msg& lhs,
}
/// @relates new_connection_msg
template
<
class
T
>
void
serialize
(
T
&
in_out
,
new_connection_msg
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
source
;
in_out
&
x
.
handle
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
new_connection_msg
&
x
,
const
unsigned
int
)
{
proc
&
x
.
source
;
proc
&
x
.
handle
;
}
/// Signalizes newly arrived data for a {@link broker}.
...
...
@@ -93,10 +93,10 @@ inline bool operator!=(const new_data_msg& lhs, const new_data_msg& rhs) {
}
/// @relates new_data_msg
template
<
class
T
>
void
serialize
(
T
&
in_out
,
new_data_msg
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
handle
;
in_out
&
x
.
buf
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
new_data_msg
&
x
,
const
unsigned
int
)
{
proc
&
x
.
handle
;
proc
&
x
.
buf
;
}
/// Signalizes that a certain amount of bytes has been written.
...
...
@@ -131,11 +131,11 @@ inline bool operator!=(const data_transferred_msg& x,
}
/// @relates new_data_msg
template
<
class
T
>
void
serialize
(
T
&
in_out
,
data_transferred_msg
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
handle
;
in_out
&
x
.
written
;
in_out
&
x
.
remaining
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
data_transferred_msg
&
x
,
const
unsigned
int
)
{
proc
&
x
.
handle
;
proc
&
x
.
written
;
proc
&
x
.
remaining
;
}
/// Signalizes that a {@link broker} connection has been closed.
...
...
@@ -161,9 +161,9 @@ inline bool operator!=(const connection_closed_msg& lhs,
}
/// @relates connection_closed_msg
template
<
class
T
>
void
serialize
(
T
&
in_out
,
connection_closed_msg
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
handle
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
connection_closed_msg
&
x
,
const
unsigned
int
)
{
proc
&
x
.
handle
;
}
/// Signalizes that a {@link broker} acceptor has been closed.
...
...
@@ -185,9 +185,9 @@ inline bool operator!=(const acceptor_closed_msg& lhs,
}
/// @relates acceptor_closed_msg
template
<
class
T
>
void
serialize
(
T
&
in_out
,
acceptor_closed_msg
&
x
,
const
unsigned
int
)
{
in_out
&
x
.
handle
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
acceptor_closed_msg
&
x
,
const
unsigned
int
)
{
proc
&
x
.
handle
;
}
}
// namespace io
...
...
libcaf_io/test/typed_remote_actor.cpp
View file @
217c2f50
...
...
@@ -39,9 +39,9 @@ struct ping {
int32_t
value
;
};
template
<
class
T
>
void
serialize
(
T
&
in_or_out
,
ping
&
x
,
const
unsigned
int
)
{
in_or_out
&
x
.
value
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
ping
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
}
bool
operator
==
(
const
ping
&
lhs
,
const
ping
&
rhs
)
{
...
...
@@ -52,9 +52,9 @@ struct pong {
int32_t
value
;
};
template
<
class
T
>
void
serialize
(
T
&
in_or_out
,
pong
&
x
,
const
unsigned
int
)
{
in_or_out
&
x
.
value
;
template
<
class
Processor
>
void
serialize
(
Processor
&
proc
,
pong
&
x
,
const
unsigned
int
)
{
proc
&
x
.
value
;
}
bool
operator
==
(
const
pong
&
lhs
,
const
pong
&
rhs
)
{
...
...
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