Line data Source code
1 : /**
2 : * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3 : * SPDX-License-Identifier: Apache-2.0
4 : */
5 :
6 : #include "backend/protobuf/query_responses/proto_block_response.hpp"
7 :
8 : namespace shared_model {
9 : namespace proto {
10 :
11 : template <typename QueryResponseType>
12 : BlockResponse::BlockResponse(QueryResponseType &&queryResponse)
13 14 : : CopyableProto(std::forward<QueryResponseType>(queryResponse)),
14 14 : block_response_{proto_->block_response()},
15 : block_{[this] { return Block(block_response_.block()); }} {}
16 :
17 : template BlockResponse::BlockResponse(BlockResponse::TransportType &);
18 : template BlockResponse::BlockResponse(const BlockResponse::TransportType &);
19 : template BlockResponse::BlockResponse(BlockResponse::TransportType &&);
20 :
21 : BlockResponse::BlockResponse(const BlockResponse &o)
22 1 : : BlockResponse(o.proto_) {}
23 :
24 : BlockResponse::BlockResponse(BlockResponse &&o) noexcept
25 14 : : BlockResponse(std::move(o.proto_)) {}
26 :
27 : const Block &BlockResponse::block() const {
28 3 : return *block_;
29 : }
30 :
31 : } // namespace proto
32 : } // namespace shared_model
|