Ditto  3.0.4
AttachmentFetchEvent.hpp
1 #ifndef _DITTO_ATTACHMENT_FETCH_EVENT_
2 #define _DITTO_ATTACHMENT_FETCH_EVENT_
3 
4 #include "Attachment.hpp"
5 
6 namespace ditto {
10 enum class AttachmentFetchEventType {
11  Completed,
12  Progress,
13  Deleted,
14 };
15 
20  friend struct AttachmentFetchEventCompleted;
21  friend struct AttachmentFetchEventProgress;
22  friend struct AttachmentFetchEventDeleted;
23 
27  AttachmentFetchEventType type;
28 
29  virtual ~AttachmentFetchEvent() = default;
30 
31 private:
32  explicit AttachmentFetchEvent(AttachmentFetchEventType type);
33 };
34 
40  friend class AttachmentFetcher;
41 
46 
47 private:
49 };
50 
56  friend class AttachmentFetcher;
57 
62  uint64_t downloaded_bytes;
63 
67  uint64_t total_bytes;
68 
69 private:
71 };
72 
77  friend class AttachmentFetcher;
78 
79 private:
80  explicit AttachmentFetchEventDeleted(); // NOLINT(modernize-use-equals-delete)
81 };
82 
83 } // namespace ditto
84 #endif
These objects are returned by calls to Collection::fetch_attachment.
Definition: AttachmentFetcher.hpp:31
Represents an attachment and can be used to insert the associated attachment into a document at a spe...
Definition: Attachment.hpp:22
An attachment fetch event used when the attachment's download has completed.
Definition: AttachmentFetchEvent.hpp:39
Attachment attachment
The successfully fetched attachment.
Definition: AttachmentFetchEvent.hpp:45
An attachment fetch event used when the attachment is deleted.
Definition: AttachmentFetchEvent.hpp:76
The different types of attachment fetch events that can be delivered.
Definition: AttachmentFetchEvent.hpp:19
AttachmentFetchEventType type
The type of the attachment fetch event.
Definition: AttachmentFetchEvent.hpp:27
An attachment fetch event used when the attachment's download has progressed but is not yet complete.
Definition: AttachmentFetchEvent.hpp:55
uint64_t total_bytes
Gets the full size of the attachment, if it were complete.
Definition: AttachmentFetchEvent.hpp:67
uint64_t downloaded_bytes
Gets the size of the attachment that was successfully downloaded, in bytes.
Definition: AttachmentFetchEvent.hpp:62