Rename ke::Lambda to ke::Function.

This commit is contained in:
David Anderson 2020-05-16 11:26:24 -07:00
parent a253e175bb
commit c2df49ee33
9 changed files with 20 additions and 20 deletions

View File

@ -67,7 +67,7 @@ struct DatabaseInfo;
class IPlayerInfoBridge;
class ICommandArgs;
typedef ke::Lambda<bool(int client, const ICommandArgs*)> CommandFunc;
typedef ke::Function<bool(int client, const ICommandArgs*)> CommandFunc;
class CoreProvider
{

View File

@ -63,7 +63,7 @@ class CommandHook : public ke::Refcounted<CommandHook>
{
public:
// return false to RETURN_META(MRES_IGNORED), or true to SUPERCEDE.
typedef ke::Lambda<bool(int, const ICommandArgs *)> Callback;
typedef ke::Function<bool(int, const ICommandArgs *)> Callback;
public:
CommandHook(ConCommand *cmd, const Callback &callback, bool post);

View File

@ -117,7 +117,7 @@ struct QHandleType
}
};
typedef ke::Lambda<void(const char *)> HandleReporter;
typedef ke::Function<void(const char *)> HandleReporter;
class HandleSystem :
public IHandleSys

View File

@ -1165,7 +1165,7 @@ bool CPlugin::ForEachExtVar(const ExtVarCallback& callback)
return true;
}
void CPlugin::ForEachLibrary(ke::Lambda<void(const char *)> callback)
void CPlugin::ForEachLibrary(ke::Function<void(const char *)> callback)
{
for (auto iter = m_Libraries.begin(); iter != m_Libraries.end(); iter++)
callback((*iter).c_str());
@ -1177,7 +1177,7 @@ void CPlugin::AddRequiredLib(const char *name)
m_RequiredLibs.push_back(name);
}
bool CPlugin::ForEachRequiredLib(ke::Lambda<bool(const char *)> callback)
bool CPlugin::ForEachRequiredLib(ke::Function<bool(const char *)> callback)
{
for (auto iter = m_RequiredLibs.begin(); iter != m_RequiredLibs.end(); iter++) {
if (!callback((*iter).c_str()))
@ -2273,7 +2273,7 @@ void CPluginManager::FreePluginList(const CVector<SMPlugin *> *list)
delete const_cast<CVector<SMPlugin *> *>(list);
}
void CPluginManager::ForEachPlugin(ke::Lambda<void(CPlugin *)> callback)
void CPluginManager::ForEachPlugin(ke::Function<void(CPlugin *)> callback)
{
for (PluginIter iter(m_plugins); !iter.done(); iter.next())
callback(*iter);

View File

@ -129,10 +129,10 @@ public:
bool required;
};
typedef ke::Lambda<bool(const sp_pubvar_t *, const ExtVar& ext)> ExtVarCallback;
typedef ke::Function<bool(const sp_pubvar_t *, const ExtVar& ext)> ExtVarCallback;
bool ForEachExtVar(const ExtVarCallback& callback);
void ForEachLibrary(ke::Lambda<void(const char *)> callback);
void ForEachLibrary(ke::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::Lambda<bool(const char *)> callback);
bool ForEachRequiredLib(ke::Function<bool(const char *)> callback);
bool HasMissingFakeNatives() const {
return m_FakeNativesMissing;
@ -432,7 +432,7 @@ public:
void _SetPauseState(CPlugin *pPlugin, bool pause);
void ForEachPlugin(ke::Lambda<void(CPlugin *)> callback);
void ForEachPlugin(ke::Function<void(CPlugin *)> callback);
private:
LoadRes LoadPlugin(CPlugin **pPlugin, const char *path, bool debug, PluginType type);

View File

@ -29,11 +29,11 @@
using namespace SourceMod;
ke::Vector<ke::Lambda<void()>> sNextTasks;
ke::Vector<ke::Lambda<void()>> sWorkTasks;
ke::Vector<ke::Function<void()>> sNextTasks;
ke::Vector<ke::Function<void()>> sWorkTasks;
void
SourceMod::ScheduleTaskForNextFrame(ke::Lambda<void()>&& task)
SourceMod::ScheduleTaskForNextFrame(ke::Function<void()>&& task)
{
sNextTasks.append(ke::Forward<decltype(task)>(task));
}
@ -45,7 +45,7 @@ SourceMod::RunScheduledFrameTasks(bool simulating)
return;
// Swap.
ke::Vector<ke::Lambda<void()>> temp(ke::Move(sNextTasks));
ke::Vector<ke::Function<void()>> temp(ke::Move(sNextTasks));
sNextTasks = ke::Move(sWorkTasks);
sWorkTasks = ke::Move(temp);

View File

@ -31,7 +31,7 @@
namespace SourceMod {
void ScheduleTaskForNextFrame(ke::Lambda<void()>&& task);
void ScheduleTaskForNextFrame(ke::Function<void()>&& task);
void RunScheduledFrameTasks(bool simulating);

@ -1 +1 @@
Subproject commit 83c4441b7ede45dfa447bdef614e924c4b7ffea9
Subproject commit 8a59372d1f8333ad455e03866b2aec7769cfb51a

@ -1 +1 @@
Subproject commit 49f94603972956a85dab61da475e92795ead40a5
Subproject commit ee2b9baac39f1e3d1e4c81600beb6b4e1f81323e