Seperated out my template algorithms and stuff.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@334 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-03-08 18:25:34 +00:00
parent f379abb200
commit a4dbdffcb8
16 changed files with 40 additions and 38 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
#include <curl/multi.h>
#include <torrent/exceptions.h>
#include "utils/functional.h"
#include "rak/functional.h"
#include "curl_get.h"
#include "curl_stack.h"
@@ -41,7 +41,7 @@ CurlStack::perform() {
CURLMsg* msg = curl_multi_info_read((CURLM*)m_handle, &t);
CurlGetList::iterator itr = std::find_if(m_getList.begin(), m_getList.end(),
utils::equal(msg->easy_handle, std::mem_fun(&CurlGet::handle)));
rak::equal(msg->easy_handle, std::mem_fun(&CurlGet::handle)));
if (itr == m_getList.end())
throw torrent::client_error("Could not find CurlGet with the right easy_handle");
+2 -2
View File
@@ -3,7 +3,7 @@
#include <algorithm>
#include <torrent/torrent.h>
#include "utils/functional.h"
#include "rak/functional.h"
#include "download.h"
#include "download_list.h"
@@ -32,7 +32,7 @@ DownloadList::erase(iterator itr) {
void
DownloadList::clear() {
std::for_each(begin(), end(), utils::call_delete<Download>());
std::for_each(begin(), end(), rak::call_delete<Download>());
Base::clear();
}
+3 -3
View File
@@ -5,7 +5,7 @@
#include <sigc++/bind.h>
#include "download.h"
#include "utils/functional.h"
#include "rak/functional.h"
#include "hash_queue.h"
namespace core {
@@ -15,7 +15,7 @@ HashQueue::insert(Download* d, Slot s) {
if (d->get_download().is_hash_checking())
return;
if (std::find_if(begin(), end(), utils::equal(d, std::mem_fun(&HashQueueNode::get_download))) != end())
if (std::find_if(begin(), end(), rak::equal(d, std::mem_fun(&HashQueueNode::get_download))) != end())
throw std::logic_error("core::HashQueue::insert(...) received a Download that is already queued");
if (d->get_download().is_hash_checked()) {
@@ -32,7 +32,7 @@ HashQueue::insert(Download* d, Slot s) {
void
HashQueue::remove(Download* d) {
iterator itr = std::find_if(begin(), end(), utils::equal(d, std::mem_fun(&HashQueueNode::get_download)));
iterator itr = std::find_if(begin(), end(), rak::equal(d, std::mem_fun(&HashQueueNode::get_download)));
if (itr == end())
return;
+1 -1
View File
@@ -6,7 +6,7 @@
#include <sigc++/hide.h>
#include <torrent/http.h>
#include "utils/functional.h"
#include "rak/functional.h"
#include "http_queue.h"
#include "curl_get.h"
+2 -3
View File
@@ -3,7 +3,7 @@
#include <algorithm>
#include "log.h"
#include "utils/functional.h"
#include "rak/functional.h"
namespace core {
@@ -16,8 +16,7 @@ Log::push_front(const std::string& msg) {
Log::iterator
Log::find_older(utils::Timer t) {
return std::find_if(begin(), end(),
utils::on(utils::mem_ptr_ref(&Type::first), std::bind2nd(std::less_equal<utils::Timer>(), t)));
return std::find_if(begin(), end(), rak::on(rak::mem_ptr_ref(&Type::first), std::bind2nd(std::less_equal<utils::Timer>(), t)));
}
}