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
da15a1d6
Commit
da15a1d6
authored
Nov 23, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback
parent
f8316e8e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
11 additions
and
41 deletions
+11
-41
libcaf_core/caf/binary_deserializer.hpp
libcaf_core/caf/binary_deserializer.hpp
+1
-1
libcaf_core/caf/binary_serializer.hpp
libcaf_core/caf/binary_serializer.hpp
+1
-0
libcaf_core/caf/callback.hpp
libcaf_core/caf/callback.hpp
+2
-2
libcaf_core/caf/deserializer.hpp
libcaf_core/caf/deserializer.hpp
+3
-6
libcaf_core/caf/detail/type_traits.hpp
libcaf_core/caf/detail/type_traits.hpp
+1
-0
libcaf_core/caf/type_erased_value.hpp
libcaf_core/caf/type_erased_value.hpp
+2
-2
libcaf_core/src/binary_deserializer.cpp
libcaf_core/src/binary_deserializer.cpp
+1
-0
libcaf_core/src/error_code.cpp
libcaf_core/src/error_code.cpp
+0
-30
No files found.
libcaf_core/caf/binary_deserializer.hpp
View file @
da15a1d6
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
namespace
caf
{
namespace
caf
{
///
Implements the deserializer interface with a binary serialization protocol
.
///
Deserializes objects from sequence of bytes
.
class
binary_deserializer
:
public
write_inspector
<
binary_deserializer
>
{
class
binary_deserializer
:
public
write_inspector
<
binary_deserializer
>
{
public:
public:
// -- member types -----------------------------------------------------------
// -- member types -----------------------------------------------------------
...
...
libcaf_core/caf/binary_serializer.hpp
View file @
da15a1d6
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
namespace
caf
{
namespace
caf
{
/// Serializes objects into a sequence of bytes.
class
binary_serializer
:
public
read_inspector
<
binary_serializer
>
{
class
binary_serializer
:
public
read_inspector
<
binary_serializer
>
{
public:
public:
// -- member types -----------------------------------------------------------
// -- member types -----------------------------------------------------------
...
...
libcaf_core/caf/callback.hpp
View file @
da15a1d6
...
@@ -45,7 +45,7 @@ public:
...
@@ -45,7 +45,7 @@ public:
virtual
Result
operator
()(
Ts
...)
=
0
;
virtual
Result
operator
()(
Ts
...)
=
0
;
};
};
/// Utility class for wrapping a function object of type `
Base
`.
/// Utility class for wrapping a function object of type `
F
`.
template
<
class
F
,
class
Signature
>
template
<
class
F
,
class
Signature
>
class
callback_impl
;
class
callback_impl
;
...
@@ -68,7 +68,7 @@ private:
...
@@ -68,7 +68,7 @@ private:
F
f_
;
F
f_
;
};
};
/// Creates a
callback from a lambda expression
.
/// Creates a
::callback from the function object `fun`
.
/// @relates callback
/// @relates callback
template
<
class
F
>
template
<
class
F
>
auto
make_callback
(
F
fun
)
{
auto
make_callback
(
F
fun
)
{
...
...
libcaf_core/caf/deserializer.hpp
View file @
da15a1d6
...
@@ -55,18 +55,15 @@ public:
...
@@ -55,18 +55,15 @@ public:
// -- interface functions ----------------------------------------------------
// -- interface functions ----------------------------------------------------
/// Begins processing of an object. Saves the type information
/// Begins processing of an object.
/// to the underlying storage.
virtual
result_type
begin_object
(
uint16_t
&
typenr
,
std
::
string
&
type_name
)
virtual
result_type
begin_object
(
uint16_t
&
typenr
,
std
::
string
&
type_name
)
=
0
;
=
0
;
/// Ends processing of an object.
/// Ends processing of an object.
virtual
result_type
end_object
()
=
0
;
virtual
result_type
end_object
()
=
0
;
/// Begins processing of a sequence. Saves the size
/// Begins processing of a sequence.
/// to the underlying storage when in saving mode, otherwise
virtual
result_type
begin_sequence
(
size_t
&
size
)
=
0
;
/// sets `num` accordingly.
virtual
result_type
begin_sequence
(
size_t
&
num
)
=
0
;
/// Ends processing of a sequence.
/// Ends processing of a sequence.
virtual
result_type
end_sequence
()
=
0
;
virtual
result_type
end_sequence
()
=
0
;
...
...
libcaf_core/caf/detail/type_traits.hpp
View file @
da15a1d6
...
@@ -717,6 +717,7 @@ struct can_apply {
...
@@ -717,6 +717,7 @@ struct can_apply {
static
auto
sfinae
(...)
->
std
::
false_type
;
static
auto
sfinae
(...)
->
std
::
false_type
;
using
type
=
decltype
(
sfinae
<
T
>
(
nullptr
));
using
type
=
decltype
(
sfinae
<
T
>
(
nullptr
));
static
constexpr
bool
value
=
type
::
value
;
static
constexpr
bool
value
=
type
::
value
;
};
};
...
...
libcaf_core/caf/type_erased_value.hpp
View file @
da15a1d6
...
@@ -99,12 +99,12 @@ public:
...
@@ -99,12 +99,12 @@ public:
};
};
/// @relates type_erased_value_impl
/// @relates type_erased_value_impl
inline
auto
inspect
(
serializer
&
f
,
type_erased_value
&
x
)
{
inline
auto
inspect
(
serializer
&
f
,
const
type_erased_value
&
x
)
{
return
x
.
save
(
f
);
return
x
.
save
(
f
);
}
}
/// @relates type_erased_value_impl
/// @relates type_erased_value_impl
inline
auto
inspect
(
binary_serializer
&
f
,
type_erased_value
&
x
)
{
inline
auto
inspect
(
binary_serializer
&
f
,
const
type_erased_value
&
x
)
{
return
x
.
save
(
f
);
return
x
.
save
(
f
);
}
}
...
...
libcaf_core/src/binary_deserializer.cpp
View file @
da15a1d6
...
@@ -217,6 +217,7 @@ result_type binary_deserializer::apply(std::u16string& x) {
...
@@ -217,6 +217,7 @@ result_type binary_deserializer::apply(std::u16string& x) {
if
(
!
range_check
(
str_size
*
sizeof
(
uint16_t
)))
if
(
!
range_check
(
str_size
*
sizeof
(
uint16_t
)))
return
sec
::
end_of_stream
;
return
sec
::
end_of_stream
;
for
(
size_t
i
=
0
;
i
<
str_size
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
str_size
;
++
i
)
{
// The standard does not guarantee that char16_t is exactly 16 bits.
uint16_t
tmp
;
uint16_t
tmp
;
unsafe_apply_int
(
*
this
,
tmp
);
unsafe_apply_int
(
*
this
,
tmp
);
x
.
push_back
(
static_cast
<
char16_t
>
(
tmp
));
x
.
push_back
(
static_cast
<
char16_t
>
(
tmp
));
...
...
libcaf_core/src/error_code.cpp
deleted
100644 → 0
View file @
f8316e8e
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright 2011-2019 Dominik Charousset *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#include "caf/error_code.hpp"
namespace
caf
::
io
::
basp
{
/// @addtogroup BASP
/// Storage type for raw bytes.
using
buffer_type
=
std
::
vector
<
char
>
;
/// @}
}
// namespace caf::io::basp
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