~unity-api-team/storage-framework/vivid

« back to all changes in this revision

Viewing changes to include/unity/storage/qt/client/internal/UploaderImpl.h

  • Committer: Michi Henning
  • Date: 2016-05-23 02:27:16 UTC
  • mto: (8.12.2 add-etag)
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: michi.henning@canonical.com-20160523022716-jpaudmuan8vxxgch
More fleshing out of the local client implementation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
class UploaderImpl
27
27
{
28
28
public:
29
 
    UploaderImpl() = default;
 
29
    UploaderImpl(std::weak_ptr<File> file);
30
30
    ~UploaderImpl() = default;
31
31
    UploaderImpl(UploaderImpl const&) = delete;
32
32
    UploaderImpl& operator=(UploaderImpl const&) = delete;
35
35
    std::shared_ptr<QLocalSocket> socket() const;
36
36
    QFuture<void> finish_upload();
37
37
    QFuture<void> cancel();
 
38
 
 
39
private:
 
40
    enum State { uninitialized, connected, finalized };
 
41
 
 
42
    State state_ = uninitialized;
 
43
    std::shared_ptr<File> file_;
 
44
    std::shared_ptr<QLocalSocket> read_socket_;
 
45
    std::shared_ptr<QLocalSocket> write_socket_;
38
46
};
39
47
 
40
48
}  // namespace internal