Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
advLigoRTS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik von Reis
advLigoRTS
Commits
fe03cdbd
Commit
fe03cdbd
authored
4 years ago
by
Jonathan Hanks
Browse files
Options
Downloads
Patches
Plain Diff
cps_recv: cleanup
Removing commented debug code from the DeflateStream and added some comments.
parent
ea4accbd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pub_sub_stream/plugins/pub_plugin_zlib.cc
+1
-18
1 addition, 18 deletions
src/pub_sub_stream/plugins/pub_plugin_zlib.cc
src/pub_sub_stream/plugins/zlib.hh
+19
-0
19 additions, 0 deletions
src/pub_sub_stream/plugins/zlib.hh
with
20 additions
and
18 deletions
src/pub_sub_stream/plugins/pub_plugin_zlib.cc
+
1
−
18
View file @
fe03cdbd
...
...
@@ -25,28 +25,11 @@ namespace cps_plugins
void
publish
(
pub_sub
::
KeyType
key
,
pub_sub
::
Message
msg
)
override
{
auto
new_msg
=
deflate_
(
msg
);
// auto check_msg = inflate_(new_msg);
publisher_
.
publish
(
key
,
new_msg
);
// if (msg.length != check_msg.length)
// {
// throw std::runtime_error("Mismatch on
// length of compression/decompression");
// }
// auto si = reinterpret_cast<const
// char*>(msg.data()); auto sd =
// reinterpret_cast<const
// char*>(check_msg.data()); if (!std::equal(si,
// si+msg.length, sd))
// {
// throw std::runtime_error("Mismatch on body
// of compression/decompression");
// }
publisher_
.
publish
(
key
,
deflate_
(
msg
)
);
}
private
:
DeflateStream
deflate_
;
InflateStream
inflate_
;
pub_sub
::
Publisher
publisher_
;
};
...
...
This diff is collapsed.
Click to expand it.
src/pub_sub_stream/plugins/zlib.hh
+
19
−
0
View file @
fe03cdbd
...
...
@@ -9,6 +9,10 @@ namespace cps_plugins
{
namespace
detail
{
/*!
* @brief Simple wrapper to take a decompress a compressed
* pub_sub::Message
*/
class
InflateStream
{
public:
...
...
@@ -26,6 +30,12 @@ namespace cps_plugins
}
}
/*!
* @brief inflate/decompress a message
* @param input the compressed message
* @return an uncompressed copy of the message
* @note raises a runtime_error on error
*/
pub_sub
::
Message
operator
(
)(
const
pub_sub
::
Message
&
input
)
{
...
...
@@ -69,6 +79,9 @@ namespace cps_plugins
z_stream
z_
;
};
/*!
* @brief Simple wrapper to compress a pub_sub::Message
*/
class
DeflateStream
{
public:
...
...
@@ -91,6 +104,12 @@ namespace cps_plugins
deflateEnd
(
&
z_
);
}
/*!
* @brief deflate/compress a message
* @param input the uncompressed message
* @return an compressed copy of the message
* @note raises a runtime_error on error
*/
pub_sub
::
Message
operator
(
)(
const
pub_sub
::
Message
&
input
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment