Ditto 4.13.1
 
Loading...
Searching...
No Matches
AttachmentFetchEvent.hpp
1#ifndef DITTO_ATTACHMENT_FETCH_EVENT_H
2#define DITTO_ATTACHMENT_FETCH_EVENT_H
3
4#include "Attachment.hpp"
5
6namespace ditto {
11 Completed,
12 Progress,
13 Deleted,
14};
15
19struct AttachmentFetchEvent {
20 friend struct AttachmentFetchEventCompleted;
21 friend struct AttachmentFetchEventProgress;
22 friend struct AttachmentFetchEventDeleted;
23
28
29public: // Public virtual destructor to allow unique_ptr upcasting.
30 virtual ~AttachmentFetchEvent() = default;
31
32private:
33 explicit AttachmentFetchEvent(AttachmentFetchEventType type);
34};
35
40struct AttachmentFetchEventCompleted : AttachmentFetchEvent {
41 friend class AttachmentFetcher;
42
47
48private:
49 explicit AttachmentFetchEventCompleted(Attachment attachment);
50};
51
56struct AttachmentFetchEventProgress : AttachmentFetchEvent {
57 friend class AttachmentFetcher;
58
64
68 uint64_t total_bytes;
69
70private:
71 AttachmentFetchEventProgress(uint64_t downloaded_bytes, uint64_t total_bytes);
72};
73
77struct AttachmentFetchEventDeleted : AttachmentFetchEvent {
78 friend class AttachmentFetcher;
79
80private:
81 // NOLINTBEGIN(modernize-use-equals-delete)
82 // NOLINTBEGIN(hicpp-use-equals-delete)
83 AttachmentFetchEventDeleted();
84 // NOLINTEND(hicpp-use-equals-delete)
85 // NOLINTEND(modernize-use-equals-delete)
86};
87
88} // namespace ditto
89#endif
Represents an attachment and can be used to insert the associated attachment into a document at a spe...
Definition Attachment.hpp:22
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19
AttachmentFetchEventType
The different types of attachment fetch events that can be delivered.
Definition AttachmentFetchEvent.hpp:10
Attachment attachment
The successfully fetched attachment.
Definition AttachmentFetchEvent.hpp:46
AttachmentFetchEventType type
The type of the attachment fetch event.
Definition AttachmentFetchEvent.hpp:27
uint64_t total_bytes
Gets the full size of the attachment, if it were complete.
Definition AttachmentFetchEvent.hpp:68
uint64_t downloaded_bytes
Gets the size of the attachment that was successfully downloaded, in bytes.
Definition AttachmentFetchEvent.hpp:63