diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:39:47 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-12-27 18:40:08 +0900 |
| commit | b1132d6b10cd3791b9529d7031d723fd0e2d8215 (patch) | |
| tree | 9ce465b42bf09372118335c7c619bb2b41869eaf /src/PieceStorage.h | |
| parent | 4abad2f64c9ff80144a61c5a9c2bea144852b883 (diff) | |
make clang-format using clang-format-3.6
Diffstat (limited to 'src/PieceStorage.h')
| -rw-r--r-- | src/PieceStorage.h | 82 |
1 files changed, 39 insertions, 43 deletions
diff --git a/src/PieceStorage.h b/src/PieceStorage.h index f777500c..a27b336c 100644 --- a/src/PieceStorage.h +++ b/src/PieceStorage.h @@ -64,28 +64,26 @@ public: */ virtual bool hasMissingPiece(const std::shared_ptr<Peer>& peer) = 0; - // Stores pieces that the peer has but localhost doesn't. Those - // pieces will be marked "used" status in order to prevent other - // command from get the same piece. But in end game mode, same - // piece may be got by several commands. This function stores N - // pieces where the sum of missing block of first N-1 pieces is - // less than minMissingBlocks and the sum of missing block of N - // pieces is greater than or equal to minMissingBlocks. If there is - // M missing pieces left where M < N, M pieces are stored. - virtual void getMissingPiece - (std::vector<std::shared_ptr<Piece> >& pieces, - size_t minMissingBlocks, - const std::shared_ptr<Peer>& peer, - cuid_t cuid) = 0; + // Stores pieces that the peer has but localhost doesn't. Those + // pieces will be marked "used" status in order to prevent other + // command from get the same piece. But in end game mode, same + // piece may be got by several commands. This function stores N + // pieces where the sum of missing block of first N-1 pieces is + // less than minMissingBlocks and the sum of missing block of N + // pieces is greater than or equal to minMissingBlocks. If there is + // M missing pieces left where M < N, M pieces are stored. + virtual void getMissingPiece(std::vector<std::shared_ptr<Piece>>& pieces, + size_t minMissingBlocks, + const std::shared_ptr<Peer>& peer, + cuid_t cuid) = 0; // Same as getMissingPiece(pieces, minMissingBlocks, peer), but the // indexes in excludedIndexes are excluded. - virtual void getMissingPiece - (std::vector<std::shared_ptr<Piece> >& pieces, - size_t minMissingBlocks, - const std::shared_ptr<Peer>& peer, - const std::vector<size_t>& excludedIndexes, - cuid_t cuid) = 0; + virtual void getMissingPiece(std::vector<std::shared_ptr<Piece>>& pieces, + size_t minMissingBlocks, + const std::shared_ptr<Peer>& peer, + const std::vector<size_t>& excludedIndexes, + cuid_t cuid) = 0; // Stores pieces that the peer has but localhost doesn't. Only // pieces that declared as "fast" are stored. Those pieces stored @@ -96,20 +94,18 @@ public: // minMissingBlocks and the sum of missing block of N pieces is // greater than or equal to minMissingBlocks. If there is M missing // pieces left where M < N, M pieces are stored. - virtual void getMissingFastPiece - (std::vector<std::shared_ptr<Piece> >& pieces, - size_t minMissingBlocks, - const std::shared_ptr<Peer>& peer, - cuid_t cuid) = 0; + virtual void getMissingFastPiece(std::vector<std::shared_ptr<Piece>>& pieces, + size_t minMissingBlocks, + const std::shared_ptr<Peer>& peer, + cuid_t cuid) = 0; // Same as getMissingFastPiece(pieces, minMissingBlocks, peer), but // the indexes in excludedIndexes are excluded. - virtual void getMissingFastPiece - (std::vector<std::shared_ptr<Piece> >& pieces, - size_t minMissingBlocks, - const std::shared_ptr<Peer>& peer, - const std::vector<size_t>& excludedIndexes, - cuid_t cuid) = 0; + virtual void getMissingFastPiece(std::vector<std::shared_ptr<Piece>>& pieces, + size_t minMissingBlocks, + const std::shared_ptr<Peer>& peer, + const std::vector<size_t>& excludedIndexes, + cuid_t cuid) = 0; /** * Returns a piece that the peer has but localhost doesn't. @@ -121,13 +117,13 @@ public: getMissingPiece(const std::shared_ptr<Peer>& peer, cuid_t cuid) = 0; /** - * Same as getMissingPiece(const std::shared_ptr<Peer>& peer), but the indexes in + * Same as getMissingPiece(const std::shared_ptr<Peer>& peer), but the indexes + * in * excludedIndexes are excluded. */ - virtual std::shared_ptr<Piece> getMissingPiece - (const std::shared_ptr<Peer>& peer, - const std::vector<size_t>& excludedIndexes, - cuid_t cuid) = 0; + virtual std::shared_ptr<Piece> + getMissingPiece(const std::shared_ptr<Peer>& peer, + const std::vector<size_t>& excludedIndexes, cuid_t cuid) = 0; #endif // ENABLE_BITTORRENT // Returns true if there is at least one missing and unused piece. @@ -137,11 +133,9 @@ public: * Returns a missing piece if available. Otherwise returns 0; * If ignoreBitfield is set, indexes of true bit are excluded. */ - virtual std::shared_ptr<Piece> getMissingPiece - (size_t minSplitSize, - const unsigned char* ignoreBitfield, - size_t length, - cuid_t cuid) = 0; + virtual std::shared_ptr<Piece> + getMissingPiece(size_t minSplitSize, const unsigned char* ignoreBitfield, + size_t length, cuid_t cuid) = 0; /** * Returns a missing piece whose index is index. @@ -170,7 +164,8 @@ public: /** * Tells that the download of the specified piece is canceled. */ - virtual void cancelPiece(const std::shared_ptr<Piece>& piece, cuid_t cuid) = 0; + virtual void cancelPiece(const std::shared_ptr<Piece>& piece, + cuid_t cuid) = 0; /** * Returns true if the specified piece is already downloaded. @@ -267,11 +262,12 @@ public: virtual void markPiecesDone(int64_t length) = 0; virtual void - addInFlightPiece(const std::vector<std::shared_ptr<Piece> >& pieces) = 0; + addInFlightPiece(const std::vector<std::shared_ptr<Piece>>& pieces) = 0; virtual size_t countInFlightPiece() = 0; - virtual void getInFlightPieces(std::vector<std::shared_ptr<Piece> >& pieces) = 0; + virtual void + getInFlightPieces(std::vector<std::shared_ptr<Piece>>& pieces) = 0; virtual void addPieceStats(size_t index) = 0; |
