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
d2093555
Commit
d2093555
authored
Aug 27, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no more black magic during serialize
parent
757f1979
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/binary_serializer.cpp
src/binary_serializer.cpp
+4
-0
No files found.
src/binary_serializer.cpp
View file @
d2093555
...
@@ -109,6 +109,7 @@ binary_serializer::binary_serializer(util::buffer* buf)
...
@@ -109,6 +109,7 @@ binary_serializer::binary_serializer(util::buffer* buf)
}
}
void
binary_serializer
::
begin_object
(
const
std
::
string
&
tname
)
{
void
binary_serializer
::
begin_object
(
const
std
::
string
&
tname
)
{
/*
if (++m_obj_count == 1) {
if (++m_obj_count == 1) {
// store a dummy size in the buffer that is
// store a dummy size in the buffer that is
// eventually updated on matching end_object()
// eventually updated on matching end_object()
...
@@ -116,10 +117,12 @@ void binary_serializer::begin_object(const std::string& tname) {
...
@@ -116,10 +117,12 @@ void binary_serializer::begin_object(const std::string& tname) {
std::uint32_t dummy_size = 0;
std::uint32_t dummy_size = 0;
m_sink->write(sizeof(std::uint32_t), &dummy_size, util::grow_if_needed);
m_sink->write(sizeof(std::uint32_t), &dummy_size, util::grow_if_needed);
}
}
*/
binary_writer
::
write_string
(
m_sink
,
tname
);
binary_writer
::
write_string
(
m_sink
,
tname
);
}
}
void
binary_serializer
::
end_object
()
{
void
binary_serializer
::
end_object
()
{
/*
if (--m_obj_count == 0) {
if (--m_obj_count == 0) {
// update the size in the buffer
// update the size in the buffer
auto data = m_sink->data();
auto data = m_sink->data();
...
@@ -128,6 +131,7 @@ void binary_serializer::end_object() {
...
@@ -128,6 +131,7 @@ void binary_serializer::end_object() {
auto wr_pos = data + m_begin_pos;
auto wr_pos = data + m_begin_pos;
memcpy(wr_pos, &s, sizeof(std::uint32_t));
memcpy(wr_pos, &s, sizeof(std::uint32_t));
}
}
*/
}
}
void
binary_serializer
::
begin_sequence
(
size_t
list_size
)
{
void
binary_serializer
::
begin_sequence
(
size_t
list_size
)
{
...
...
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