Replace ke::Function use with std::function.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <IAdminSystem.h>
|
||||
#include <amtl/am-function.h>
|
||||
#include <functional>
|
||||
|
||||
// SDK types.
|
||||
#if defined(SM_LOGIC)
|
||||
@@ -62,7 +62,7 @@ struct DatabaseInfo;
|
||||
class IPlayerInfoBridge;
|
||||
class ICommandArgs;
|
||||
|
||||
typedef ke::Function<bool(int client, const ICommandArgs*)> CommandFunc;
|
||||
typedef std::function<bool(int client, const ICommandArgs*)> CommandFunc;
|
||||
|
||||
class CoreProvider
|
||||
{
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@
|
||||
#include <iserverplugin.h>
|
||||
#include <amtl/am-refcounting.h>
|
||||
#include <amtl/am-vector.h>
|
||||
#include <amtl/am-function.h>
|
||||
#include <functional>
|
||||
|
||||
class ConVar;
|
||||
class CCommand;
|
||||
@@ -63,7 +63,7 @@ class CommandHook : public ke::Refcounted<CommandHook>
|
||||
{
|
||||
public:
|
||||
// return false to RETURN_META(MRES_IGNORED), or true to SUPERCEDE.
|
||||
typedef ke::Function<bool(int, const ICommandArgs *)> Callback;
|
||||
typedef std::function<bool(int, const ICommandArgs *)> Callback;
|
||||
|
||||
public:
|
||||
CommandHook(ConCommand *cmd, const Callback &callback, bool post);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include <amtl/am-string.h>
|
||||
#include <amtl/am-function.h>
|
||||
#include <functional>
|
||||
#include <IHandleSys.h>
|
||||
#include <sm_namehashset.h>
|
||||
#include "common_logic.h"
|
||||
@@ -123,7 +123,7 @@ struct QHandleType
|
||||
}
|
||||
};
|
||||
|
||||
typedef ke::Function<void(const char *)> HandleReporter;
|
||||
typedef std::function<void(const char *)> HandleReporter;
|
||||
|
||||
class HandleSystem :
|
||||
public IHandleSys
|
||||
|
||||
@@ -1284,7 +1284,7 @@ bool CPlugin::ForEachExtVar(const ExtVarCallback& callback)
|
||||
return true;
|
||||
}
|
||||
|
||||
void CPlugin::ForEachLibrary(ke::Function<void(const char *)> callback)
|
||||
void CPlugin::ForEachLibrary(std::function<void(const char *)> callback)
|
||||
{
|
||||
for (auto iter = m_Libraries.begin(); iter != m_Libraries.end(); iter++)
|
||||
callback((*iter).c_str());
|
||||
@@ -1296,7 +1296,7 @@ void CPlugin::AddRequiredLib(const char *name)
|
||||
m_RequiredLibs.push_back(name);
|
||||
}
|
||||
|
||||
bool CPlugin::ForEachRequiredLib(ke::Function<bool(const char *)> callback)
|
||||
bool CPlugin::ForEachRequiredLib(std::function<bool(const char *)> callback)
|
||||
{
|
||||
for (auto iter = m_RequiredLibs.begin(); iter != m_RequiredLibs.end(); iter++) {
|
||||
if (!callback((*iter).c_str()))
|
||||
@@ -2392,7 +2392,7 @@ void CPluginManager::FreePluginList(const std::vector<SMPlugin *> *list)
|
||||
delete const_cast<std::vector<SMPlugin *> *>(list);
|
||||
}
|
||||
|
||||
void CPluginManager::ForEachPlugin(ke::Function<void(CPlugin *)> callback)
|
||||
void CPluginManager::ForEachPlugin(std::function<void(CPlugin *)> callback)
|
||||
{
|
||||
for (PluginIter iter(m_plugins); !iter.done(); iter.next())
|
||||
callback(*iter);
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
#include "PhraseCollection.h"
|
||||
#include <am-string.h>
|
||||
#include <bridge/include/IScriptManager.h>
|
||||
#include <am-function.h>
|
||||
#include <functional>
|
||||
#include <ReentrantList.h>
|
||||
|
||||
class CPlayer;
|
||||
@@ -129,10 +129,10 @@ public:
|
||||
bool required;
|
||||
};
|
||||
|
||||
typedef ke::Function<bool(const char *pubvar_name, const ExtVar& ext)> ExtVarCallback;
|
||||
typedef std::function<bool(const char *pubvar_name, const ExtVar& ext)> ExtVarCallback;
|
||||
bool ForEachExtVar(const ExtVarCallback& callback);
|
||||
|
||||
void ForEachLibrary(ke::Function<void(const char *)> callback);
|
||||
void ForEachLibrary(std::function<void(const char *)> callback);
|
||||
public:
|
||||
/**
|
||||
* Creates a plugin object with default values.
|
||||
@@ -215,7 +215,7 @@ public:
|
||||
}
|
||||
|
||||
void AddRequiredLib(const char *name);
|
||||
bool ForEachRequiredLib(ke::Function<bool(const char *)> callback);
|
||||
bool ForEachRequiredLib(std::function<bool(const char *)> callback);
|
||||
|
||||
bool HasMissingFakeNatives() const {
|
||||
return m_FakeNativesMissing;
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
|
||||
void _SetPauseState(CPlugin *pPlugin, bool pause);
|
||||
|
||||
void ForEachPlugin(ke::Function<void(CPlugin *)> callback);
|
||||
void ForEachPlugin(std::function<void(CPlugin *)> callback);
|
||||
private:
|
||||
LoadRes LoadPlugin(CPlugin **pPlugin, const char *path, bool debug, PluginType type);
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
|
||||
using namespace SourceMod;
|
||||
|
||||
std::vector<ke::Function<void()>> sNextTasks;
|
||||
std::vector<ke::Function<void()>> sWorkTasks;
|
||||
std::vector<std::function<void()>> sNextTasks;
|
||||
std::vector<std::function<void()>> sWorkTasks;
|
||||
|
||||
void
|
||||
SourceMod::ScheduleTaskForNextFrame(ke::Function<void()>&& task)
|
||||
SourceMod::ScheduleTaskForNextFrame(std::function<void()>&& task)
|
||||
{
|
||||
sNextTasks.push_back(std::forward<decltype(task)>(task));
|
||||
}
|
||||
@@ -46,7 +46,7 @@ SourceMod::RunScheduledFrameTasks(bool simulating)
|
||||
return;
|
||||
|
||||
// Swap.
|
||||
std::vector<ke::Function<void()>> temp(std::move(sNextTasks));
|
||||
std::vector<std::function<void()>> temp(std::move(sNextTasks));
|
||||
sNextTasks = std::move(sWorkTasks);
|
||||
sWorkTasks = std::move(temp);
|
||||
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
#ifndef _include_sourcemod_logic_frame_tasks_h_
|
||||
#define _include_sourcemod_logic_frame_tasks_h_
|
||||
|
||||
#include <am-function.h>
|
||||
#include <functional>
|
||||
|
||||
namespace SourceMod {
|
||||
|
||||
void ScheduleTaskForNextFrame(ke::Function<void()>&& task);
|
||||
void ScheduleTaskForNextFrame(std::function<void()>&& task);
|
||||
|
||||
void RunScheduledFrameTasks(bool simulating);
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@
|
||||
#include <list>
|
||||
#include <utility>
|
||||
|
||||
#include <amtl/am-function.h>
|
||||
|
||||
namespace SourceMod {
|
||||
|
||||
// ReentrantList is a wrapper around a std::list, with special attention twoard
|
||||
|
||||
Reference in New Issue
Block a user