Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
byte_stream_reassembly.h
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <protocols/reassembly.h>
19 
20 namespace transport {
21 
22 namespace protocol {
23 
25  public:
27  TransportProtocol *transport_protocol);
28 
29  protected:
30  void reassemble(core::ContentObject &content_object) override;
31 
32  void reassemble(
33  std::unique_ptr<core::ContentObjectManifest> &&manifest) override;
34 
35  void reassemble(utils::MemBuf &buffer, uint32_t suffix) override;
36 
37  bool copyContent(core::ContentObject &content_object);
38 
39  virtual void reInitialize() override;
40 
41  private:
42  void assembleContent();
43 
44  protected:
45  std::unordered_map<std::uint32_t, core::ContentObject::Ptr> received_packets_;
46  uint32_t index_;
47  bool download_complete_;
48 };
49 
50 } // namespace protocol
51 
52 } // end namespace transport
transport::interface::ConsumerSocket
Main interface for consumer applications.
Definition: socket_consumer.h:48
transport::protocol::ByteStreamReassembly::reInitialize
virtual void reInitialize() override
transport::core::ContentObject
Definition: content_object.h:29
transport::protocol::ByteStreamReassembly::reassemble
void reassemble(core::ContentObject &content_object) override
transport::protocol::ByteStreamReassembly
Definition: byte_stream_reassembly.h:24
transport
Definition: forwarder_config.h:32
transport::protocol::TransportProtocol
Definition: transport_protocol.h:41
transport::protocol::Reassembly
Definition: reassembly.h:35
utils::MemBuf
Definition: membuf.h:45