P2P File Share
A simple peer-to-peer file sharing system.
Loading...
Searching...
No Matches
DownloadManager Class Reference

If you need a file downloaded, ask the professional. More...

#include <downloadmanager.hpp>

Public Member Functions

 DownloadManager (FilesDB &files_db, PeerDB &peer_db, const Endpoint &client_endpoint, const EndpointID &my_id)
 
 ~DownloadManager ()
 
 DownloadManager (const DownloadManager &)=delete
 
DownloadManageroperator= (const DownloadManager &)=delete
 
 DownloadManager (DownloadManager &&)=delete
 
bool enqueue_download (const std::string &group_id, const std::shared_ptr< FileInfo > file_info, const std::string &output_file_path)
 
bool dequeue_download (const std::string &group_id, const std::string &file_name)
 
bool start_downloads ()
 
bool pause_downloads ()
 
void set_on_download_complete (std::function< void(const std::string &group_id, const std::string &file_name)> on_download_complete)
 
std::string list_downloads () const
 

Detailed Description

If you need a file downloaded, ask the professional.

A DownloadManager object cannot be copied or moved.

Constructor & Destructor Documentation

◆ DownloadManager() [1/3]

DownloadManager::DownloadManager ( FilesDB & files_db,
PeerDB & peer_db,
const Endpoint & client_endpoint,
const EndpointID & my_id )

◆ ~DownloadManager()

DownloadManager::~DownloadManager ( )

◆ DownloadManager() [2/3]

DownloadManager::DownloadManager ( const DownloadManager & )
delete

◆ DownloadManager() [3/3]

DownloadManager::DownloadManager ( DownloadManager && )
delete

Member Function Documentation

◆ dequeue_download()

bool DownloadManager::dequeue_download ( const std::string & group_id,
const std::string & file_name )

◆ enqueue_download()

bool DownloadManager::enqueue_download ( const std::string & group_id,
const std::shared_ptr< FileInfo > file_info,
const std::string & output_file_path )

◆ list_downloads()

std::string DownloadManager::list_downloads ( ) const

◆ operator=()

DownloadManager & DownloadManager::operator= ( const DownloadManager & )
delete

◆ pause_downloads()

bool DownloadManager::pause_downloads ( )

◆ set_on_download_complete()

void DownloadManager::set_on_download_complete ( std::function< void(const std::string &group_id, const std::string &file_name)> on_download_complete)

◆ start_downloads()

bool DownloadManager::start_downloads ( )

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