Remove/replace functional_fun.h functions

This commit is contained in:
kannibalox
2024-12-18 12:01:43 -05:00
committed by Jari Sundell
parent 0d1b9e9d55
commit cd9948a4a8
9 changed files with 7 additions and 670 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ CommandScheduler::call_item(value_type item) {
rpc::call_object(item->command());
} catch (torrent::input_error& e) {
if (m_slotErrorMessage.is_valid())
if (m_slotErrorMessage)
m_slotErrorMessage("Scheduled command failed: " + item->key() + ": " + e.what());
}
+2 -3
View File
@@ -40,7 +40,6 @@
#include <cstdint>
#include <vector>
#include <string>
#include <rak/functional_fun.h>
namespace torrent {
class Object;
@@ -52,7 +51,7 @@ class CommandSchedulerItem;
class CommandScheduler : public std::vector<CommandSchedulerItem*> {
public:
typedef rak::function1<void, const std::string&> SlotString;
typedef std::function<void (const std::string&)> SlotString;
typedef std::pair<int, int> Time;
typedef std::vector<CommandSchedulerItem*> base_type;
@@ -63,7 +62,7 @@ public:
CommandScheduler() {}
~CommandScheduler();
void set_slot_error_message(SlotString::base_type* s) { m_slotErrorMessage.set(s); }
void set_slot_error_message(SlotString s) { m_slotErrorMessage = s; }
// slot_error_message or something.
+1 -4
View File
@@ -166,13 +166,10 @@ SCgi::event_error() {
bool
SCgi::receive_call(SCgiTask* task, const char* buffer, uint32_t length) {
slot_write slotWrite;
slotWrite.set(rak::mem_fn(task, &SCgiTask::receive_write));
torrent::thread_base::acquire_global_lock();
torrent::main_thread()->interrupt();
bool result = xmlrpc.process(buffer, length, slotWrite);
bool result = xmlrpc.process(buffer, length, [task](const char* b, uint32_t l) { return task->receive_write(b, l); });
torrent::thread_base::release_global_lock();
+2 -3
View File
@@ -37,8 +37,7 @@
#ifndef RTORRENT_RPC_SCGI_H
#define RTORRENT_RPC_SCGI_H
#include <string>
#include <rak/functional_fun.h>
#include <functional>
#include <torrent/event.h>
#include "scgi_task.h"
@@ -51,7 +50,7 @@ namespace rpc {
class lt_cacheline_aligned SCgi : public torrent::Event {
public:
typedef rak::function2<bool, const char*, uint32_t> slot_write;
typedef std::function<bool (const char*, uint32_t)> slot_write;
static const int max_tasks = 100;