RMQ - RabbitMQ C++ Library
rmqa_compressiontransformer.h
1// Copyright 2025 Bloomberg Finance L.P.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#ifndef INCLUDED_RMQA_COMPRESSIONTRANSFORMER
17#define INCLUDED_RMQA_COMPRESSIONTRANSFORMER
18
19#include <rmqp_messagetransformer.h>
20#include <rmqt_properties.h>
21#include <rmqt_result.h>
22
23#include <bsl_memory.h>
24#include <bsl_string.h>
25#include <bsl_vector.h>
26#include <bslma_managedptr.h>
27#include <bsls_keyword.h>
28
29namespace BloombergLP {
30namespace rmqa {
31
38 public:
39 // CREATORS
45
47 bslma::ManagedPtr<rmqp::MessageTransformer>& impl);
48
50
51 // MANIPULATORS
67 rmqt::Result<bool> transform(bsl::shared_ptr<bsl::vector<uint8_t> >& data,
68 rmqt::Properties& props);
69
79 inverseTransform(bsl::shared_ptr<bsl::vector<uint8_t> >& data,
80 rmqt::Properties& props);
81
84 bsl::string name() const;
85
86 private:
87 CompressionTransformer(const CompressionTransformer&) BSLS_KEYWORD_DELETED;
89 operator=(const CompressionTransformer&) BSLS_KEYWORD_DELETED;
90
91 private:
92 bslma::ManagedPtr<rmqp::MessageTransformer> d_impl;
93};
94
95} // namespace rmqa
96} // namespace BloombergLP
97
98#endif
A message transformer that compresses messages using zstd.
Definition: rmqa_compressiontransformer.h:37
bsl::string name() const
Definition: rmqa_compressiontransformer.cpp:55
rmqt::Result< bool > transform(bsl::shared_ptr< bsl::vector< uint8_t > > &data, rmqt::Properties &props)
Definition: rmqa_compressiontransformer.cpp:42
static rmqt::Result< rmqp::MessageTransformer > create()
Definition: rmqa_compressiontransformer.cpp:27
rmqt::Result inverseTransform(bsl::shared_ptr< bsl::vector< uint8_t > > &data, rmqt::Properties &props)
Definition: rmqa_compressiontransformer.cpp:48
A result of an operation.
Definition: rmqt_result.h:37
Properties is an minimal abstraction of the properties one can set on a message.
Definition: rmqt_properties.h:73