libzypp 17.31.23
metalinkinfo_p.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8----------------------------------------------------------------------/
9*
10* This file contains private API, this might break at any time between releases.
11* You have been warned!
12*
13*/
14#ifndef ZYPP_CURL_NG_NETWORK_PRIVATE_DOWNLOADERSTATES_METALINKINFO_P_H_INCLUDED
15#define ZYPP_CURL_NG_NETWORK_PRIVATE_DOWNLOADERSTATES_METALINKINFO_P_H_INCLUDED
16
17#include "base_p.h"
18#include "basicdownloader_p.h"
19#include <zypp-core/zyppng/base/statemachine.h>
20
21namespace zyppng {
22
23 struct FinishedState;
24 struct PrepareMultiState;
25
26 enum class MetaDataType {
27 None = 0,
28 Zsync,
30 };
31
38 static constexpr auto stateId = Download::DlMetaLinkInfo;
39
41 DlMetaLinkInfoState( std::shared_ptr<Request> &&prevRequest, DownloadPrivate &parent );
42
43 SignalProxy< void () > sigFinished() {
44 return _sigFinished;
45 }
46 SignalProxy< void () > sigGotMetadata() {
47 return _sigGotMetadata;
48 }
49 SignalProxy< void () > sigFailed() {
50 return _sigFailed;
51 }
52
53 std::shared_ptr<FinishedState> transitionToFinished ();
54 std::shared_ptr<PrepareMultiState> transitionToPrepareMulti ();
55
56 bool initializeRequest( std::shared_ptr<Request> &r ) override;
57 virtual void gotFinished () override;
58
59 protected:
61 Signal< void () > _sigGotMetadata;
62
63 virtual void handleRequestProgress ( NetworkRequest &req, off_t dltotal, off_t dlnow ) override;
64
65 private:
66 bool _fallbackMilWritten = false; //< Flag to know if we already logged that we fall back to the normal progress
67 };
68
69}
70
71#endif
SignalProxy< void() > sigGotMetadata()
virtual void gotFinished() override
Signal< void() > _sigGotMetadata
SignalProxy< void() > sigFailed()
std::shared_ptr< FinishedState > transitionToFinished()
SignalProxy< void() > sigFinished()
virtual void handleRequestProgress(NetworkRequest &req, off_t dltotal, off_t dlnow) override
static constexpr auto stateId
bool initializeRequest(std::shared_ptr< Request > &r) override
std::shared_ptr< PrepareMultiState > transitionToPrepareMulti()