TorrentWrapper Class Reference

#include <torrentwrapper.h>

Collaboration diagram for TorrentWrapper:
Collaboration graph
[legend]

Public Types

enum  DownloadRequestStatus {
  success = 0, file_not_found = 2, torrent_join_failed = 3, remote_file_dl_failed = 4,
  corrupt_torrent_file = 5, no_seeds_found = 6
}

Public Member Functions

 TorrentWrapper ()
 ~TorrentWrapper ()
bool IsFileInSystem (const wxString &name)
 gui interface
bool RemoveTorrentByName (const wxString &name)
int GetTorrentSystemStatus () const
void SetIngameStatus (bool status)
 lobby interface
void RequestFileByName (const wxString &name)
 will add name to a queue that's processed from a worker thread, to avoid GUI blocking
void ClearFinishedTorrents ()
 remove all torrents that have seed status
DownloadRequestStatus AddTorrent (const PlasmaResourceInfo &info)
 insert a downloaded torrent file/resource info into the libt session
void UpdateSettings ()
std::map< wxString, TorrentInfosCollectGuiInfos ()
void RemoveInvalidTorrents ()
 threaded maintenance tasks
void HandleCompleted ()
void ResumeFromList ()

Private Types

typedef std::vector
< libtorrent::torrent_handle > 
TorrenthandleVector
typedef std::map
< PlasmaResourceInfo,
libtorrent::torrent_handle > 
TorrenthandleInfoMap
 internal

Private Member Functions

P2P::FileStatus getP2PStatusFromHandle (const libtorrent::torrent_handle &handle) const
 translate handle status to P2Pstatus
TorrenthandleInfoMapGetHandleInfoMap ()

Private Attributes

MutexWrapper
< TorrenthandleInfoMap
m_handleInfo_map
wxString m_buffer
bool ingame
unsigned int m_timer_count
wxArrayString m_tracker_urls
TorrentMaintenanceThread m_maintenance_thread
libtorrent::session * m_torr
bool m_started
WorkerThread m_info_download_thread

Detailed Description

Definition at line 83 of file torrentwrapper.h.


Member Typedef Documentation

typedef std::map<PlasmaResourceInfo,libtorrent::torrent_handle> TorrentWrapper::TorrenthandleInfoMap [private]

internal

Definition at line 132 of file torrentwrapper.h.

typedef std::vector<libtorrent::torrent_handle> TorrentWrapper::TorrenthandleVector [private]

Definition at line 129 of file torrentwrapper.h.


Member Enumeration Documentation

Enumerator:
success 
file_not_found 
torrent_join_failed 
remote_file_dl_failed 
corrupt_torrent_file 
no_seeds_found 

Definition at line 90 of file torrentwrapper.h.


Constructor & Destructor Documentation

TorrentWrapper::TorrentWrapper (  ) 

Definition at line 152 of file torrentwrapper.cpp.

TorrentWrapper::~TorrentWrapper (  ) 

Definition at line 222 of file torrentwrapper.cpp.


Member Function Documentation

TorrentWrapper::DownloadRequestStatus TorrentWrapper::AddTorrent ( const PlasmaResourceInfo info  ) 

insert a downloaded torrent file/resource info into the libt session

Definition at line 375 of file torrentwrapper.cpp.

void TorrentWrapper::ClearFinishedTorrents (  ) 

remove all torrents that have seed status

Definition at line 625 of file torrentwrapper.cpp.

std::map< wxString, TorrentInfos > TorrentWrapper::CollectGuiInfos (  ) 

Definition at line 541 of file torrentwrapper.cpp.

TorrenthandleInfoMap& TorrentWrapper::GetHandleInfoMap (  )  [inline, private]

Definition at line 135 of file torrentwrapper.h.

P2P::FileStatus TorrentWrapper::getP2PStatusFromHandle ( const libtorrent::torrent_handle &  handle  )  const [private]

translate handle status to P2Pstatus

Definition at line 88 of file torrentwrapper.cpp.

int TorrentWrapper::GetTorrentSystemStatus (  )  const

Definition at line 350 of file torrentwrapper.cpp.

void TorrentWrapper::HandleCompleted (  ) 

Definition at line 480 of file torrentwrapper.cpp.

bool TorrentWrapper::IsFileInSystem ( const wxString name  ) 

gui interface

Definition at line 317 of file torrentwrapper.cpp.

void TorrentWrapper::RemoveInvalidTorrents (  ) 

threaded maintenance tasks

TODO: should this remove all files as well??

Definition at line 592 of file torrentwrapper.cpp.

bool TorrentWrapper::RemoveTorrentByName ( const wxString name  ) 

Definition at line 332 of file torrentwrapper.cpp.

void TorrentWrapper::RequestFileByName ( const wxString name  ) 

will add name to a queue that's processed from a worker thread, to avoid GUI blocking

Definition at line 369 of file torrentwrapper.cpp.

void TorrentWrapper::ResumeFromList (  ) 

Definition at line 463 of file torrentwrapper.cpp.

void TorrentWrapper::SetIngameStatus ( bool  status  ) 

lobby interface

Definition at line 408 of file torrentwrapper.cpp.

void TorrentWrapper::UpdateSettings (  ) 

Definition at line 284 of file torrentwrapper.cpp.


Field Documentation

bool TorrentWrapper::ingame [private]

Definition at line 143 of file torrentwrapper.h.

Definition at line 141 of file torrentwrapper.h.

Definition at line 133 of file torrentwrapper.h.

Definition at line 154 of file torrentwrapper.h.

Definition at line 148 of file torrentwrapper.h.

bool TorrentWrapper::m_started [private]

Definition at line 152 of file torrentwrapper.h.

unsigned int TorrentWrapper::m_timer_count [private]

Definition at line 144 of file torrentwrapper.h.

libtorrent::session* TorrentWrapper::m_torr [private]

Definition at line 150 of file torrentwrapper.h.

wxArrayString TorrentWrapper::m_tracker_urls [private]

Definition at line 146 of file torrentwrapper.h.


The documentation for this class was generated from the following files:

Generated on Thu Dec 29 00:11:49 2011 for SpringLobby by doxygen 1.6.3