cpp-msgpack-rpc
0.2.0
An RPC library implementing MessagePack RPC.
Toggle main menu visibility
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"
25
#include "
msgpack_rpc/messages/impl/sharable_binary_header_fwd.h
"
26
27
namespace
msgpack_rpc::messages
{
28
34
class
MSGPACK_RPC_EXPORT
SerializedMessage
{
35
public
:
42
SerializedMessage
(
const
char
*
data
, std::size_t
size
);
43
51
explicit
SerializedMessage
(
impl::SharableBinaryHeader
* buffer);
52
58
SerializedMessage
(
const
SerializedMessage
& other)
noexcept
;
59
65
SerializedMessage
(
SerializedMessage
&& other)
noexcept
;
66
73
SerializedMessage
&
operator=
(
const
SerializedMessage
& other)
noexcept
;
74
81
SerializedMessage
&
operator=
(
SerializedMessage
&& other)
noexcept
;
82
86
~SerializedMessage
()
noexcept
;
87
93
[[nodiscard]]
const
char
*
data
()
const
noexcept
;
94
100
[[nodiscard]] std::size_t
size
()
const
noexcept
;
101
102
private
:
104
impl::SharableBinaryHeader
*
buffer_
;
105
};
106
107
}
// namespace msgpack_rpc::messages
msgpack_rpc::messages::SerializedMessage::buffer_
impl::SharableBinaryHeader * buffer_
Buffer.
Definition
serialized_message.h:104
msgpack_rpc::messages::SerializedMessage::operator=
SerializedMessage & operator=(const SerializedMessage &other) noexcept
Copy assignment operator.
Definition
serialized_message.cpp:48
msgpack_rpc::messages::SerializedMessage::data
const char * data() const noexcept
Get the pointer to the data.
Definition
serialized_message.cpp:73
msgpack_rpc::messages::SerializedMessage::SerializedMessage
SerializedMessage(const char *data, std::size_t size)
Constructor.
Definition
serialized_message.cpp:30
msgpack_rpc::messages::SerializedMessage::size
std::size_t size() const noexcept
Get the size of the data.
Definition
serialized_message.cpp:77
msgpack_rpc::messages
Namespace of messages.
Definition
buffer_view.h:24
sharable_binary_header_fwd.h
Declaration of SharableBinaryHeader struct.
msgpack_rpc::messages::impl::SharableBinaryHeader
Struct of headers of sharable binary data.
Definition
sharable_binary_header.h:36
include
msgpack_rpc
messages
serialized_message.h
Generated on
for cpp-msgpack-rpc by
1.18.0