3es  0.7
3esresourcepacker.h
1 //
2 // author: Kazys Stepanas
3 //
4 #ifndef _3ESRESOURCEPACKER_H_
5 #define _3ESRESOURCEPACKER_H_
6 
7 #include "3es-core.h"
8 
9 #include <cstdint>
10 
11 namespace tes
12 {
13  class Resource;
14  struct TransferProgress;
15  class PacketWriter;
16 
17  class _3es_coreAPI ResourcePacker
18  {
19  public:
21  ~ResourcePacker();
22 
23  inline const Resource *resource() const { return _resource; }
24  inline bool isNull() const { return _resource == nullptr; }
25  void transfer(const Resource *resource);
26  void cancel();
27 
28  inline uint64_t lastCompletedId() const { return _lastCompletedId; }
29 
30  bool nextPacket(PacketWriter &packet, unsigned byteLimit);
31 
32  private:
33  const Resource *_resource;
34  TransferProgress *_progress;
35  uint64_t _lastCompletedId;
36  bool _started;
37  };
38 }
39 
40 #endif // _3ESRESOURCEPACKER_H_
Definition: 3esbounds.h:13
A structure tracking progress of a data transfer.
Definition: 3estransferprogress.h:18
The Resource base class defines an interface for any resource used by Shape objects such as MeshSet...
Definition: 3esresource.h:34
A utility class for writing payload data to a PacketHeader.
Definition: 3espacketwriter.h:34
Definition: 3esresourcepacker.h:17