~ubuntu-branches/ubuntu/wily/aria2/wily-proposed

« back to all changes in this revision

Viewing changes to src/ShareRatioSeedCriteria.h

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry, Patrick Ruckstuhl
  • Date: 2013-09-22 18:52:14 UTC
  • mfrom: (2.5.19 sid)
  • Revision ID: package-import@ubuntu.com-20130922185214-upeu2ljgeqi7e7oo
Tags: 1.18.0-1
[ Kartik Mistry ]
* New upstream release.
* debian/control:
  + (really) Set priority to optional from extra (Closes: #697659).
  + wrap-and-sort some fields.

[ Patrick Ruckstuhl ]
* debian/rules:
  + Allow parallel building (Closes: #720977)
* debian/tests, debian/control:
  + autopkgtest infrastructure

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
#include "SeedCriteria.h"
39
39
 
 
40
#include <memory>
 
41
 
40
42
namespace aria2 {
41
43
 
42
44
class DownloadContext;
46
48
class ShareRatioSeedCriteria : public SeedCriteria {
47
49
private:
48
50
  double ratio_;
49
 
  SharedHandle<DownloadContext> downloadContext_;
50
 
  SharedHandle<BtRuntime> btRuntime_;
51
 
  SharedHandle<PieceStorage> pieceStorage_;
 
51
  std::shared_ptr<DownloadContext> downloadContext_;
 
52
  std::shared_ptr<BtRuntime> btRuntime_;
 
53
  std::shared_ptr<PieceStorage> pieceStorage_;
52
54
public:
53
55
  ShareRatioSeedCriteria
54
 
  (double ratio, const SharedHandle<DownloadContext>& downloadContext);
 
56
  (double ratio, const std::shared_ptr<DownloadContext>& downloadContext);
55
57
 
56
58
  virtual ~ShareRatioSeedCriteria();
57
59
 
58
 
  virtual void reset();
 
60
  virtual void reset() CXX11_OVERRIDE;
59
61
 
60
 
  virtual bool evaluate();
 
62
  virtual bool evaluate() CXX11_OVERRIDE;
61
63
 
62
64
  void setRatio(double ratio) {
63
65
    ratio_ = ratio;
67
69
    return ratio_;
68
70
  }
69
71
 
70
 
  void setBtRuntime(const SharedHandle<BtRuntime>& btRuntime);
 
72
  void setBtRuntime(const std::shared_ptr<BtRuntime>& btRuntime);
71
73
 
72
 
  void setPieceStorage(const SharedHandle<PieceStorage>& pieceStorage);
 
74
  void setPieceStorage(const std::shared_ptr<PieceStorage>& pieceStorage);
73
75
};
74
76
 
75
77
} // namespace aria2