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
1a7c1c88
Commit
1a7c1c88
authored
Jul 11, 2016
by
Matthias Vallentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Uses more intuitive inspector distinguishers
parent
ecc37096
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
25 additions
and
19 deletions
+25
-19
libcaf_core/caf/data_processor.hpp
libcaf_core/caf/data_processor.hpp
+10
-10
libcaf_core/caf/deserializer.hpp
libcaf_core/caf/deserializer.hpp
+4
-1
libcaf_core/caf/detail/stringification_inspector.hpp
libcaf_core/caf/detail/stringification_inspector.hpp
+1
-1
libcaf_core/caf/node_id.hpp
libcaf_core/caf/node_id.hpp
+2
-2
libcaf_core/caf/optional.hpp
libcaf_core/caf/optional.hpp
+2
-2
libcaf_core/caf/serializer.hpp
libcaf_core/caf/serializer.hpp
+4
-1
libcaf_core/caf/type_erased_tuple.hpp
libcaf_core/caf/type_erased_tuple.hpp
+2
-2
No files found.
libcaf_core/caf/data_processor.hpp
View file @
1a7c1c88
...
...
@@ -170,7 +170,7 @@ public:
template
<
class
D
,
atom_value
V
>
static
error
apply_atom_constant
(
D
&
self
,
atom_constant
<
V
>&
)
{
static_assert
(
D
::
is_saving
::
valu
e
,
"cannot deserialize an atom_constant"
);
static_assert
(
!
D
::
writes_stat
e
,
"cannot deserialize an atom_constant"
);
auto
x
=
V
;
return
self
.
apply
(
x
);
}
...
...
@@ -275,7 +275,7 @@ public:
// Applies this processor as Derived to `xs` in saving mode.
template
<
class
D
,
class
T
>
static
typename
std
::
enable_if
<
D
::
is_saving
::
valu
e
&&
!
detail
::
is_byte_sequence
<
T
>::
value
,
D
::
reads_stat
e
&&
!
detail
::
is_byte_sequence
<
T
>::
value
,
error
>::
type
apply_sequence
(
D
&
self
,
T
&
xs
)
{
...
...
@@ -288,7 +288,7 @@ public:
// Applies this processor as Derived to `xs` in loading mode.
template
<
class
D
,
class
T
>
static
typename
std
::
enable_if
<
!
D
::
is_saving
::
valu
e
&&
!
detail
::
is_byte_sequence
<
T
>::
value
,
!
D
::
reads_stat
e
&&
!
detail
::
is_byte_sequence
<
T
>::
value
,
error
>::
type
apply_sequence
(
D
&
self
,
T
&
xs
)
{
...
...
@@ -301,7 +301,7 @@ public:
// Optimized saving for contiguous byte sequences.
template
<
class
D
,
class
T
>
static
typename
std
::
enable_if
<
D
::
is_saving
::
valu
e
&&
detail
::
is_byte_sequence
<
T
>::
value
,
D
::
reads_stat
e
&&
detail
::
is_byte_sequence
<
T
>::
value
,
error
>::
type
apply_sequence
(
D
&
self
,
T
&
xs
)
{
...
...
@@ -314,7 +314,7 @@ public:
// Optimized loading for contiguous byte sequences.
template
<
class
D
,
class
T
>
static
typename
std
::
enable_if
<
!
D
::
is_saving
::
valu
e
&&
detail
::
is_byte_sequence
<
T
>::
value
,
!
D
::
reads_stat
e
&&
detail
::
is_byte_sequence
<
T
>::
value
,
error
>::
type
apply_sequence
(
D
&
self
,
T
&
xs
)
{
...
...
@@ -443,7 +443,7 @@ public:
template
<
class
F
,
class
...
Ts
>
error
operator
()(
meta
::
save_callback_t
<
F
>
x
,
Ts
&&
...
xs
)
{
error
e
;
if
(
Derived
::
is_saving
::
valu
e
)
if
(
Derived
::
reads_stat
e
)
e
=
x
.
fun
();
return
e
?
e
:
(
*
this
)(
std
::
forward
<
Ts
>
(
xs
)...);
}
...
...
@@ -451,7 +451,7 @@ public:
template
<
class
F
,
class
...
Ts
>
error
operator
()(
meta
::
load_callback_t
<
F
>
x
,
Ts
&&
...
xs
)
{
error
e
;
if
(
Derived
::
is_loading
::
valu
e
)
if
(
Derived
::
writes_stat
e
)
e
=
x
.
fun
();
return
e
?
e
:
(
*
this
)(
std
::
forward
<
Ts
>
(
xs
)...);
}
...
...
@@ -477,7 +477,7 @@ public:
error
>::
type
operator
()(
T
&&
x
,
Ts
&&
...
xs
)
{
static_assert
(
Derived
::
is_saving
::
valu
e
static_assert
(
Derived
::
reads_stat
e
||
(
!
std
::
is_rvalue_reference
<
T
&&>::
value
&&
!
std
::
is_const
<
typename
std
::
remove_reference
<
T
>::
type
...
...
@@ -498,14 +498,14 @@ private:
}
template
<
class
D
,
class
T
,
class
U
,
class
F
>
static
typename
std
::
enable_if
<
D
::
is_saving
::
valu
e
,
error
>::
type
static
typename
std
::
enable_if
<
D
::
reads_stat
e
,
error
>::
type
convert_apply
(
D
&
self
,
T
&
x
,
U
&
storage
,
F
assign
)
{
assign
(
storage
,
x
);
return
self
.
apply
(
storage
);
}
template
<
class
D
,
class
T
,
class
U
,
class
F
>
static
typename
std
::
enable_if
<!
D
::
is_saving
::
valu
e
,
error
>::
type
static
typename
std
::
enable_if
<!
D
::
reads_stat
e
,
error
>::
type
convert_apply
(
D
&
self
,
T
&
x
,
U
&
storage
,
F
assign
)
{
auto
e
=
self
.
apply
(
storage
);
if
(
e
)
...
...
libcaf_core/caf/deserializer.hpp
View file @
1a7c1c88
...
...
@@ -44,8 +44,11 @@ public:
using
super
=
data_processor
<
deserializer
>
;
using
is_saving
=
std
::
false_type
;
static
constexpr
bool
reads_state
=
false
;
static
constexpr
bool
writes_state
=
true
;
// Boost Serialization compatibility
using
is_saving
=
std
::
false_type
;
using
is_loading
=
std
::
true_type
;
explicit
deserializer
(
actor_system
&
sys
);
...
...
libcaf_core/caf/detail/stringification_inspector.hpp
View file @
1a7c1c88
...
...
@@ -49,7 +49,7 @@ public:
using
result_type
=
void
;
using
is_saving
=
std
::
true_typ
e
;
static
constexpr
bool
reads_state
=
tru
e
;
// -- constructors, destructors, and assignment operators --------------------
...
...
libcaf_core/caf/node_id.hpp
View file @
1a7c1c88
...
...
@@ -129,7 +129,7 @@ public:
explicit
node_id
(
intrusive_ptr
<
data
>
dataptr
);
template
<
class
Inspector
>
friend
detail
::
enable_if_t
<
Inspector
::
is_saving
::
valu
e
,
friend
detail
::
enable_if_t
<
Inspector
::
reads_stat
e
,
typename
Inspector
::
result_type
>
inspect
(
Inspector
&
f
,
node_id
&
x
)
{
data
tmp
;
...
...
@@ -139,7 +139,7 @@ public:
}
template
<
class
Inspector
>
friend
detail
::
enable_if_t
<
Inspector
::
is_loading
::
valu
e
,
friend
detail
::
enable_if_t
<
Inspector
::
writes_stat
e
,
typename
Inspector
::
result_type
>
inspect
(
Inspector
&
f
,
node_id
&
x
)
{
data
tmp
;
...
...
libcaf_core/caf/optional.hpp
View file @
1a7c1c88
...
...
@@ -262,7 +262,7 @@ class optional<void> {
};
template
<
class
Inspector
,
class
T
>
typename
std
::
enable_if
<
Inspector
::
is_saving
::
valu
e
,
typename
std
::
enable_if
<
Inspector
::
reads_stat
e
,
typename
Inspector
::
result_type
>::
type
inspect
(
Inspector
&
f
,
optional
<
T
>&
x
)
{
return
x
?
f
(
true
,
*
x
)
:
f
(
false
);
...
...
@@ -280,7 +280,7 @@ struct optional_inspect_helper {
};
template
<
class
Inspector
,
class
T
>
typename
std
::
enable_if
<
Inspector
::
is_loading
::
valu
e
,
typename
std
::
enable_if
<
Inspector
::
writes_stat
e
,
typename
Inspector
::
result_type
>::
type
inspect
(
Inspector
&
f
,
optional
<
T
>&
x
)
{
bool
flag
;
...
...
libcaf_core/caf/serializer.hpp
View file @
1a7c1c88
...
...
@@ -41,8 +41,11 @@ class serializer : public data_processor<serializer> {
public:
using
super
=
data_processor
<
serializer
>
;
using
is_saving
=
std
::
true_type
;
static
constexpr
bool
reads_state
=
true
;
static
constexpr
bool
writes_state
=
false
;
// Boost Serialization compatibility
using
is_saving
=
std
::
true_type
;
using
is_loading
=
std
::
false_type
;
explicit
serializer
(
actor_system
&
sys
);
...
...
libcaf_core/caf/type_erased_tuple.hpp
View file @
1a7c1c88
...
...
@@ -191,14 +191,14 @@ private:
/// @relates type_erased_tuple
template
<
class
Processor
>
typename
std
::
enable_if
<
Processor
::
is_saving
::
valu
e
>::
type
typename
std
::
enable_if
<
Processor
::
reads_stat
e
>::
type
serialize
(
Processor
&
proc
,
type_erased_tuple
&
x
)
{
x
.
save
(
proc
);
}
/// @relates type_erased_tuple
template
<
class
Processor
>
typename
std
::
enable_if
<
Processor
::
is_loading
::
valu
e
>::
type
typename
std
::
enable_if
<
Processor
::
writes_stat
e
>::
type
serialize
(
Processor
&
proc
,
type_erased_tuple
&
x
)
{
x
.
load
(
proc
);
}
...
...
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