File indexing completed on 2024-04-21 04:57:12

0001 /* This file is part of the KDE project
0002 
0003    Copyright (C) 2008 Lukas Appelhans <l.appelhans@gmx.de>
0004    Copyright (C) 2005 Joris Guisson <joris.guisson@gmail.com>
0005 
0006    This program is free software; you can redistribute it and/or
0007    modify it under the terms of the GNU General Public
0008    License as published by the Free Software Foundation; either
0009    version 2 of the License, or (at your option) any later version.
0010 */
0011 
0012 #include "btchunkselector.h"
0013 
0014 #include <algorithm>
0015 #include <cstdlib>
0016 #include <vector>
0017 
0018 #include <diskio/chunkmanager.h>
0019 #include <download/downloader.h>
0020 #include <interfaces/piecedownloader.h>
0021 #include <peer/chunkcounter.h>
0022 #include <peer/peer.h>
0023 #include <peer/peermanager.h>
0024 #include <util/bitset.h>
0025 #include <util/log.h>
0026 
0027 using namespace bt;
0028 
0029 BTChunkSelector::BTChunkSelector(ChunkManager &cman, Downloader &downer, PeerManager &pman)
0030 {
0031     this->ChunkSelector::init(&cman, &downer, &pman);
0032 }
0033 
0034 BTChunkSelector::~BTChunkSelector()
0035 {
0036 }
0037 
0038 BTChunkSelectorFactory::BTChunkSelectorFactory()
0039 {
0040 }
0041 
0042 BTChunkSelectorFactory::~BTChunkSelectorFactory()
0043 {
0044 }
0045 
0046 bt::ChunkSelectorInterface *BTChunkSelectorFactory::createChunkSelector(bt::ChunkManager &cman, bt::Downloader &downer, bt::PeerManager &pman)
0047 {
0048     BTChunkSelector *selector = new BTChunkSelector(cman, downer, pman);
0049     emit selectorAdded(selector);
0050     return selector;
0051 }
0052 
0053 #include "moc_btchunkselector.cpp"