cpp-msgpack-rpc 0.2.0
An RPC library implementing MessagePack RPC.
Loading...
Searching...
No Matches
serialized_message.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 MusicScience37 (Kenta Kabashima)
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 */
20#pragma once
21
22#include <cstddef>
23
24#include "msgpack_rpc/impl/msgpack_rpc_export.h"
26
27namespace msgpack_rpc::messages {
28
34class MSGPACK_RPC_EXPORT SerializedMessage {
35public:
42 SerializedMessage(const char* data, std::size_t size);
43
52
58 SerializedMessage(const SerializedMessage& other) noexcept;
59
65 SerializedMessage(SerializedMessage&& other) noexcept;
66
73 SerializedMessage& operator=(const SerializedMessage& other) noexcept;
74
82
86 ~SerializedMessage() noexcept;
87
93 [[nodiscard]] const char* data() const noexcept;
94
100 [[nodiscard]] std::size_t size() const noexcept;
101
102private:
105};
106
107} // namespace msgpack_rpc::messages
impl::SharableBinaryHeader * buffer_
Buffer.
SerializedMessage & operator=(const SerializedMessage &other) noexcept
Copy assignment operator.
const char * data() const noexcept
Get the pointer to the data.
SerializedMessage(const char *data, std::size_t size)
Constructor.
std::size_t size() const noexcept
Get the size of the data.
Namespace of messages.
Definition buffer_view.h:24
Declaration of SharableBinaryHeader struct.
Struct of headers of sharable binary data.