RMQ - RabbitMQ C++ Library
rmqp_messagetransformer.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_RMQP_MESSAGETRANSFORMER
17#define INCLUDED_RMQP_MESSAGETRANSFORMER
18
19#include <rmqt_properties.h>
20#include <rmqt_result.h>
21
22#include <bsl_memory.h>
23#include <bsl_string.h>
24#include <bsl_vector.h>
25
26namespace BloombergLP {
27namespace rmqp {
28
31 public:
32 virtual ~MessageTransformer() {};
33
42 virtual rmqt::Result<bool>
43 transform(bsl::shared_ptr<bsl::vector<uint8_t> >& data,
44 rmqt::Properties& props) = 0;
45
51 virtual rmqt::Result<>
52 inverseTransform(bsl::shared_ptr<bsl::vector<uint8_t> >& data,
53 rmqt::Properties& props) = 0;
54
55 virtual bsl::string name() const = 0;
56};
57
58} // namespace rmqp
59} // namespace BloombergLP
60
61#endif
Abstract class for message transformations.
Definition: rmqp_messagetransformer.h:30
virtual rmqt::Result inverseTransform(bsl::shared_ptr< bsl::vector< uint8_t > > &data, rmqt::Properties &props)=0
Inverse transform the data and properties of a message.
virtual rmqt::Result< bool > transform(bsl::shared_ptr< bsl::vector< uint8_t > > &data, rmqt::Properties &props)=0
Transform the data and properties of a message.
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