Electroneum
tools::download_thread_control Struct Reference
Collaboration diagram for tools::download_thread_control:

Public Member Functions

 download_thread_control (const std::string &path, const std::string &uri, std::function< void(const std::string &, const std::string &, bool)> result_cb, std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> progress_cb)
 
 ~download_thread_control ()
 

Public Attributes

const std::string path
 
const std::string uri
 
std::function< void(const std::string &, const std::string &, bool)> result_cb
 
std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> progress_cb
 
bool stop
 
bool stopped
 
bool success
 
boost::thread thread
 
boost::mutex mutex
 

Detailed Description

Definition at line 43 of file download.cpp.

Constructor & Destructor Documentation

◆ download_thread_control()

tools::download_thread_control::download_thread_control ( const std::string &  path,
const std::string &  uri,
std::function< void(const std::string &, const std::string &, bool)>  result_cb,
std::function< bool(const std::string &, const std::string &, size_t, ssize_t)>  progress_cb 
)
inline

Definition at line 55 of file download.cpp.

55  :
56  path(path), uri(uri), result_cb(result_cb), progress_cb(progress_cb), stop(false), stopped(false), success(false) {}
const std::string path
Definition: download.cpp:45
std::function< bool(const std::string &, const std::string &, size_t, ssize_t)> progress_cb
Definition: download.cpp:48
std::function< void(const std::string &, const std::string &, bool)> result_cb
Definition: download.cpp:47

◆ ~download_thread_control()

tools::download_thread_control::~download_thread_control ( )
inline

Definition at line 57 of file download.cpp.

57 { if (thread.joinable()) thread.detach(); }

Member Data Documentation

◆ mutex

boost::mutex tools::download_thread_control::mutex

Definition at line 53 of file download.cpp.

◆ path

const std::string tools::download_thread_control::path

Definition at line 45 of file download.cpp.

◆ progress_cb

std::function<bool(const std::string&, const std::string&, size_t, ssize_t)> tools::download_thread_control::progress_cb

Definition at line 48 of file download.cpp.

◆ result_cb

std::function<void(const std::string&, const std::string&, bool)> tools::download_thread_control::result_cb

Definition at line 47 of file download.cpp.

◆ stop

bool tools::download_thread_control::stop

Definition at line 49 of file download.cpp.

◆ stopped

bool tools::download_thread_control::stopped

Definition at line 50 of file download.cpp.

◆ success

bool tools::download_thread_control::success

Definition at line 51 of file download.cpp.

◆ thread

boost::thread tools::download_thread_control::thread

Definition at line 52 of file download.cpp.

◆ uri

const std::string tools::download_thread_control::uri

Definition at line 46 of file download.cpp.


The documentation for this struct was generated from the following file: