LeviLamina
Loading...
Searching...
No Matches
FileChunkManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/container/MovePriorityQueue.h"
7
8// auto generated forward declare list
9// clang-format off
10struct FileChunk;
11struct FileChunkInfo;
12// clang-format on
13
15public:
16 // member variables
17 // NOLINTBEGIN
18 ::ll::TypedStorage<8, 8, uint64> mTotalSize;
19 ::ll::TypedStorage<4, 4, uint> mChunkSize;
20 ::ll::TypedStorage<8, 8, uint64> mTotalNbChunks;
21 ::ll::TypedStorage<8, 8, uint64> mRequestedChunks;
22 ::ll::TypedStorage<8, 8, uint64> mReceivedChunks;
23 ::ll::TypedStorage<8, 8, uint64> mWrittenChunks;
24 ::ll::TypedStorage<8, 24, ::std::vector<::FileChunkInfo>> mChunkInfo;
25 ::ll::TypedStorage<8, 24, ::MovePriorityQueue<::FileChunk, ::std::less<::FileChunk>>> mChunkQueue;
26 // NOLINTEND
27
28public:
29 // member functions
30 // NOLINTBEGIN
32
33 MCNAPI void _generateChunkInfo();
34
35#ifdef LL_PLAT_C
36 MCNAPI bool canWriteChunk() const;
37
38 MCNAPI ::FileChunk dequeueChunk();
39
40 MCNAPI int getAndIncrementNextChunk();
41#endif
42
43 MCNAPI ::FileChunkInfo getChunkInfo(int chunkID) const;
44
45 MCNAPI ::std::vector<::FileChunkInfo> const& getChunks() const;
46
47#ifdef LL_PLAT_C
48 MCNAPI uint64 getDownloadedBytes() const;
49
50 MCNAPI float getProgress() const;
51#endif
52
54
55#ifdef LL_PLAT_C
56 MCNAPI void queueReceivedChunk(::FileChunk&& chunk);
57
58 MCNAPI bool requestedAllChunks() const;
59
60 MCNAPI void reset();
61#endif
62
63 MCNAPI void reset(uint64 totalSize, uint chunkSize);
64
65#ifdef LL_PLAT_C
66 MCNAPI bool writtenAllChunks() const;
67
68 MCNAPI ~FileChunkManager();
69#endif
70 // NOLINTEND
71
72public:
73 // constructor thunks
74 // NOLINTBEGIN
75 MCNAPI void* $ctor();
76 // NOLINTEND
77
78public:
79 // destructor thunk
80 // NOLINTBEGIN
81#ifdef LL_PLAT_C
82 MCNAPI void $dtor();
83#endif
84 // NOLINTEND
85};
MCAPI FileChunkManager()
MCAPI ::std::vector<::FileChunkInfo > const & getChunks() const
MCAPI void reset(uint64 totalSize, uint chunkSize)
MCAPI void * $ctor()
MCAPI int getTotalNumberOfChunks()
MCAPI::FileChunkInfo getChunkInfo(int chunkID) const
MCAPI void _generateChunkInfo()
Definition FileChunkInfo.h:5
Definition FileChunk.h:8