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
c5f6c835
Commit
c5f6c835
authored
Jun 10, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'issue/1097'
Closes #1097
parents
e3f7e64c
9bc0b035
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
26 deletions
+24
-26
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+2
-1
libcaf_core/caf/fwd.hpp
libcaf_core/caf/fwd.hpp
+2
-2
libcaf_core/src/binary_serializer.cpp
libcaf_core/src/binary_serializer.cpp
+9
-9
libcaf_core/src/detail/serialized_size.cpp
libcaf_core/src/detail/serialized_size.cpp
+4
-4
libcaf_core/test/detail/meta_object.cpp
libcaf_core/test/detail/meta_object.cpp
+2
-2
libcaf_core/test/serialization.cpp
libcaf_core/test/serialization.cpp
+4
-4
libcaf_io/caf/io/basp/instance.hpp
libcaf_io/caf/io/basp/instance.hpp
+1
-1
libcaf_io/src/io/basp_broker.cpp
libcaf_io/src/io/basp_broker.cpp
+0
-1
libcaf_openssl/test/openssl/authentication.cpp
libcaf_openssl/test/openssl/authentication.cpp
+0
-1
libcaf_openssl/test/openssl/remote_actor.cpp
libcaf_openssl/test/openssl/remote_actor.cpp
+0
-1
No files found.
libcaf_core/caf/detail/type_traits.hpp
View file @
c5f6c835
...
...
@@ -711,7 +711,8 @@ template <class T, class Arg>
struct
can_apply
{
template
<
class
U
>
static
auto
sfinae
(
U
*
x
)
->
decltype
(
x
->
apply
(
std
::
declval
<
Arg
>
()),
std
::
true_type
{});
->
decltype
(
CAF_IGNORE_UNUSED
(
x
->
apply
(
std
::
declval
<
Arg
>
())),
std
::
true_type
{});
template
<
class
U
>
static
auto
sfinae
(...)
->
std
::
false_type
;
...
...
libcaf_core/caf/fwd.hpp
View file @
c5f6c835
...
...
@@ -33,7 +33,7 @@ namespace caf {
template
<
class
>
class
behavior_type_of
;
template
<
class
>
class
dictionary
;
template
<
class
>
class
downstream
;
template
<
class
>
class
error_code
;
template
<
class
>
class
[[
nodiscard
]]
error_code
;
template
<
class
>
class
expected
;
template
<
class
>
class
intrusive_cow_ptr
;
template
<
class
>
class
intrusive_ptr
;
...
...
@@ -106,7 +106,7 @@ class config_value;
class
deserializer
;
class
downstream_manager
;
class
downstream_manager_base
;
class
error
;
class
[[
nodiscard
]]
error
;
class
event_based_actor
;
class
execution_unit
;
class
forwarding_actor_proxy
;
...
...
libcaf_core/src/binary_serializer.cpp
View file @
c5f6c835
...
...
@@ -142,34 +142,34 @@ void binary_serializer::apply(long double x) {
}
void
binary_serializer
::
apply
(
string_view
x
)
{
begin_sequence
(
x
.
size
(
));
CAF_IGNORE_UNUSED
(
begin_sequence
(
x
.
size
()
));
apply
(
as_bytes
(
make_span
(
x
)));
end_sequence
(
);
CAF_IGNORE_UNUSED
(
end_sequence
()
);
}
void
binary_serializer
::
apply
(
const
std
::
u16string
&
x
)
{
auto
str_size
=
x
.
size
();
begin_sequence
(
str_size
);
CAF_IGNORE_UNUSED
(
begin_sequence
(
str_size
)
);
// The standard does not guarantee that char16_t is exactly 16 bits.
for
(
auto
c
:
x
)
apply_int
(
*
this
,
static_cast
<
uint16_t
>
(
c
));
end_sequence
(
);
CAF_IGNORE_UNUSED
(
end_sequence
()
);
}
void
binary_serializer
::
apply
(
const
std
::
u32string
&
x
)
{
auto
str_size
=
x
.
size
();
begin_sequence
(
str_size
);
CAF_IGNORE_UNUSED
(
begin_sequence
(
str_size
)
);
// The standard does not guarantee that char32_t is exactly 32 bits.
for
(
auto
c
:
x
)
apply_int
(
*
this
,
static_cast
<
uint32_t
>
(
c
));
end_sequence
(
);
CAF_IGNORE_UNUSED
(
end_sequence
()
);
}
void
binary_serializer
::
apply
(
const
std
::
vector
<
bool
>&
x
)
{
auto
len
=
x
.
size
();
begin_sequence
(
len
);
CAF_IGNORE_UNUSED
(
begin_sequence
(
len
)
);
if
(
len
==
0
)
{
end_sequence
(
);
CAF_IGNORE_UNUSED
(
end_sequence
()
);
return
;
}
size_t
pos
=
0
;
...
...
@@ -231,7 +231,7 @@ void binary_serializer::apply(const std::vector<bool>& x) {
}
apply
(
tmp
);
}
end_sequence
(
);
CAF_IGNORE_UNUSED
(
end_sequence
()
);
}
}
// namespace caf
libcaf_core/src/detail/serialized_size.cpp
View file @
c5f6c835
...
...
@@ -119,19 +119,19 @@ error serialized_size_inspector::apply(long double x) {
}
error
serialized_size_inspector
::
apply
(
string_view
x
)
{
begin_sequence
(
x
.
size
(
));
CAF_IGNORE_UNUSED
(
begin_sequence
(
x
.
size
()
));
result_
+=
x
.
size
();
return
end_sequence
();
}
error
serialized_size_inspector
::
apply
(
const
std
::
u16string
&
x
)
{
begin_sequence
(
x
.
size
(
));
CAF_IGNORE_UNUSED
(
begin_sequence
(
x
.
size
()
));
result_
+=
x
.
size
()
*
sizeof
(
uint16_t
);
return
end_sequence
();
}
error
serialized_size_inspector
::
apply
(
const
std
::
u32string
&
x
)
{
begin_sequence
(
x
.
size
(
));
CAF_IGNORE_UNUSED
(
begin_sequence
(
x
.
size
()
));
result_
+=
x
.
size
()
*
sizeof
(
uint32_t
);
return
end_sequence
();
}
...
...
@@ -142,7 +142,7 @@ error serialized_size_inspector::apply(span<const byte> x) {
}
error
serialized_size_inspector
::
apply
(
const
std
::
vector
<
bool
>&
xs
)
{
begin_sequence
(
xs
.
size
(
));
CAF_IGNORE_UNUSED
(
begin_sequence
(
xs
.
size
()
));
result_
+=
(
xs
.
size
()
+
static_cast
<
size_t
>
(
xs
.
size
()
%
8
!=
0
))
/
8
;
return
end_sequence
();
}
...
...
libcaf_core/test/detail/meta_object.cpp
View file @
c5f6c835
...
...
@@ -67,12 +67,12 @@ CAF_TEST(meta objects allow serialization of objects) {
binary_serializer
sink
{
nullptr
,
buf
};
meta_i32_wrapper
.
default_construct
(
&
storage
);
CAF_CHECK_EQUAL
(
i32_wrapper
::
instances
,
1u
);
meta_i32_wrapper
.
save_binary
(
sink
,
&
storag
e
);
CAF_CHECK_EQUAL
(
meta_i32_wrapper
.
save_binary
(
sink
,
&
storage
),
non
e
);
i32_wrapper
copy
;
CAF_CHECK_EQUAL
(
i32_wrapper
::
instances
,
2u
);
copy
.
value
=
42
;
binary_deserializer
source
{
nullptr
,
buf
};
meta_i32_wrapper
.
load_binary
(
source
,
&
copy
);
CAF_CHECK_EQUAL
(
meta_i32_wrapper
.
load_binary
(
source
,
&
copy
),
none
);
CAF_CHECK_EQUAL
(
copy
.
value
,
0
);
meta_i32_wrapper
.
destroy
(
&
storage
);
CAF_CHECK_EQUAL
(
i32_wrapper
::
instances
,
1u
);
...
...
libcaf_core/test/serialization.cpp
View file @
c5f6c835
...
...
@@ -309,12 +309,12 @@ CAF_TEST(long_sequences) {
byte_buffer
data
;
binary_serializer
sink
{
nullptr
,
data
};
size_t
n
=
std
::
numeric_limits
<
uint32_t
>::
max
();
sink
.
begin_sequence
(
n
);
sink
.
end_sequence
(
);
CAF_CHECK_EQUAL
(
sink
.
begin_sequence
(
n
),
none
);
CAF_CHECK_EQUAL
(
sink
.
end_sequence
(),
none
);
binary_deserializer
source
{
nullptr
,
data
};
size_t
m
=
0
;
source
.
begin_sequence
(
m
);
source
.
end_sequence
(
);
CAF_CHECK_EQUAL
(
source
.
begin_sequence
(
m
),
none
);
CAF_CHECK_EQUAL
(
source
.
end_sequence
(),
none
);
CAF_CHECK_EQUAL
(
n
,
m
);
}
...
...
libcaf_io/caf/io/basp/instance.hpp
View file @
c5f6c835
...
...
@@ -111,7 +111,7 @@ public:
/// Describes a callback function object for `remove_published_actor`.
using
removed_published_actor
=
callback
<
error_code
<
sec
>
(
const
strong_actor_ptr
&
,
uint16_t
)
>
;
=
callback
<
void
(
const
strong_actor_ptr
&
,
uint16_t
)
>
;
instance
(
abstract_broker
*
parent
,
callee
&
lstnr
);
...
...
libcaf_io/src/io/basp_broker.cpp
View file @
c5f6c835
...
...
@@ -349,7 +349,6 @@ behavior basp_broker::make_behavior() {
CAF_LOG_TRACE
(
CAF_ARG
(
whom
)
<<
CAF_ARG
(
port
));
auto
cb
=
make_callback
([
&
](
const
strong_actor_ptr
&
,
uint16_t
x
)
{
close
(
hdl_by_port
(
x
));
return
error_code
<
sec
>
{};
});
if
(
instance
.
remove_published_actor
(
whom
,
port
,
&
cb
)
==
0
)
return
sec
::
no_actor_published_at_port
;
...
...
libcaf_openssl/test/openssl/authentication.cpp
View file @
c5f6c835
...
...
@@ -54,7 +54,6 @@ public:
config
()
{
load
<
io
::
middleman
>
();
load
<
openssl
::
manager
>
();
actor_system_config
::
parse
(
test
::
engine
::
argc
(),
test
::
engine
::
argv
());
set
(
"middleman.manual-multiplexing"
,
true
);
set
(
"middleman.attach-utility-actors"
,
true
);
set
(
"scheduler.policy"
,
"testing"
);
...
...
libcaf_openssl/test/openssl/remote_actor.cpp
View file @
c5f6c835
...
...
@@ -41,7 +41,6 @@ public:
config
()
{
load
<
io
::
middleman
>
();
load
<
openssl
::
manager
>
();
actor_system_config
::
parse
(
test
::
engine
::
argc
(),
test
::
engine
::
argv
());
// Setting the "max consecutive reads" to 1 is highly likely to cause
// OpenSSL to buffer data internally and report "pending" data after a read
// operation. This will trigger `must_read_more` in the SSL read policy
...
...
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