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
0fc7c3a5
Commit
0fc7c3a5
authored
Aug 16, 2019
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make binary_serializer an alias type
parent
38fa6481
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
91 deletions
+6
-91
libcaf_core/CMakeLists.txt
libcaf_core/CMakeLists.txt
+0
-1
libcaf_core/caf/binary_serializer.hpp
libcaf_core/caf/binary_serializer.hpp
+2
-87
libcaf_core/caf/fwd.hpp
libcaf_core/caf/fwd.hpp
+4
-3
No files found.
libcaf_core/CMakeLists.txt
View file @
0fc7c3a5
...
...
@@ -32,7 +32,6 @@ set(LIBCAF_CORE_SRCS
src/behavior_impl.cpp
src/behavior_stack.cpp
src/binary_deserializer.cpp
src/binary_serializer.cpp
src/blocking_actor.cpp
src/blocking_behavior.cpp
src/chars.cpp
...
...
libcaf_core/caf/binary_serializer.hpp
View file @
0fc7c3a5
...
...
@@ -18,97 +18,12 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <vector>
#include "caf/serializer.hpp"
#include "caf/serializer
_impl
.hpp"
namespace
caf
{
/// Implements the serializer interface with a binary serialization protocol.
class
binary_serializer
final
:
public
serializer
{
public:
// -- member types -----------------------------------------------------------
using
super
=
serializer
;
using
buffer
=
std
::
vector
<
char
>
;
// -- constructors, destructors, and assignment operators --------------------
binary_serializer
(
actor_system
&
sys
,
buffer
&
buf
);
binary_serializer
(
execution_unit
*
ctx
,
buffer
&
buf
);
// -- position management ----------------------------------------------------
/// Sets the write position to given offset.
/// @pre `offset <= buf.size()`
void
seek
(
size_t
offset
);
/// Jumps `num_bytes` forward. Resizes the buffer (filling it with zeros)
/// when skipping past the end.
void
skip
(
size_t
num_bytes
);
// -- overridden member functions --------------------------------------------
error
begin_object
(
uint16_t
&
typenr
,
std
::
string
&
name
)
override
;
error
end_object
()
override
;
error
begin_sequence
(
size_t
&
list_size
)
override
;
error
end_sequence
()
override
;
error
apply_raw
(
size_t
num_bytes
,
void
*
data
)
override
;
// -- properties -------------------------------------------------------------
buffer
&
buf
()
{
return
buf_
;
}
const
buffer
&
buf
()
const
{
return
buf_
;
}
size_t
write_pos
()
const
noexcept
{
return
write_pos_
;
}
protected:
error
apply_impl
(
int8_t
&
)
override
;
error
apply_impl
(
uint8_t
&
)
override
;
error
apply_impl
(
int16_t
&
)
override
;
error
apply_impl
(
uint16_t
&
)
override
;
error
apply_impl
(
int32_t
&
)
override
;
error
apply_impl
(
uint32_t
&
)
override
;
error
apply_impl
(
int64_t
&
)
override
;
error
apply_impl
(
uint64_t
&
)
override
;
error
apply_impl
(
float
&
)
override
;
error
apply_impl
(
double
&
)
override
;
error
apply_impl
(
long
double
&
)
override
;
error
apply_impl
(
std
::
string
&
)
override
;
error
apply_impl
(
std
::
u16string
&
)
override
;
error
apply_impl
(
std
::
u32string
&
)
override
;
private:
buffer
&
buf_
;
size_t
write_pos_
;
};
using
binary_serializer
=
serializer_impl
<
std
::
vector
<
char
>>
;
}
// namespace caf
libcaf_core/caf/fwd.hpp
View file @
0fc7c3a5
...
...
@@ -22,6 +22,7 @@
#include <map>
#include <memory>
#include <tuple>
#include <vector>
#include "caf/detail/is_one_of.hpp"
#include "caf/detail/is_primitive_config_value.hpp"
...
...
@@ -39,6 +40,7 @@ template <class> class intrusive_cow_ptr;
template
<
class
>
class
intrusive_ptr
;
template
<
class
>
class
optional
;
template
<
class
>
class
param
;
template
<
class
>
class
serializer_impl
;
template
<
class
>
class
stream
;
template
<
class
>
class
stream_sink
;
template
<
class
>
class
stream_source
;
...
...
@@ -89,7 +91,6 @@ class actor_system;
class
actor_system_config
;
class
behavior
;
class
binary_deserializer
;
class
binary_serializer
;
class
blocking_actor
;
class
config_option
;
class
config_option_adder
;
...
...
@@ -173,11 +174,11 @@ enum class stream_priority;
// -- aliases ------------------------------------------------------------------
using
actor_id
=
uint64_t
;
using
binary_serializer
=
serializer_impl
<
std
::
vector
<
char
>>
;
using
ip_address
=
ipv6_address
;
using
ip_subnet
=
ipv6_subnet
;
using
stream_slot
=
uint16_t
;
using
settings
=
dictionary
<
config_value
>
;
using
stream_slot
=
uint16_t
;
// -- functions ----------------------------------------------------------------
...
...
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