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