- Added a ChunkMap class responsible for allocating new chunks to be downloaded, according to

- a given chunk strategy
	- the availablility map of each source 
- Integrated this into ftFileCreator
- added gui menu in file transfer+right click to change the chunk strategy: streaming vs. random

Next step: 
	- loading/saving file downloading state and availability map
	- displaying chunk details in the selected transfer tab (e.g. list of currently worked chunks, and their current downloading completion)



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1863 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-12-08 22:29:52 +00:00
parent de0cbd50ce
commit 25a09900e9
16 changed files with 584 additions and 173 deletions

View file

@ -35,7 +35,6 @@
#include "ftfileprovider.h"
#include "ftchunkmap.h"
#include <map>
class ftChunk;
class ftFileCreator: public ftFileProvider
{
@ -51,12 +50,13 @@ virtual bool getFileData(uint64_t offset, uint32_t &chunk_size, void *data);
uint64_t getRecvd();
void getChunkMap(FileChunksInfo& info) ;
void setChunkStrategy(FileChunksInfo::ChunkStrategy s) ;
/*
* creation functions for FileCreator
*/
bool getMissingChunk(uint64_t &offset, uint32_t &chunk);
bool getMissingChunk(const std::string& peer_id,uint32_t size_hint,uint64_t& offset, uint32_t& size);
bool addFileData(uint64_t offset, uint32_t chunk_size, void *data);
protected:
@ -79,15 +79,4 @@ private:
ChunkMap chunkMap ;
};
class ftChunk {
public:
ftChunk(uint64_t,uint64_t,time_t);
ftChunk():offset(0), chunk(0), ts(0) {}
~ftChunk();
uint64_t offset;
uint64_t chunk;
time_t ts;
};
#endif // FT_FILE_CREATOR_HEADER