Rename ke::Lambda to ke::Function.
This commit is contained in:
parent
a253e175bb
commit
c2df49ee33
@ -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
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -117,7 +117,7 @@ struct QHandleType
|
||||
}
|
||||
};
|
||||
|
||||
typedef ke::Lambda<void(const char *)> HandleReporter;
|
||||
typedef ke::Function<void(const char *)> HandleReporter;
|
||||
|
||||
class HandleSystem :
|
||||
public IHandleSys
|
||||
|
@ -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);
|
||||
@ -2394,4 +2394,4 @@ static OldPluginAPI sOldPluginAPI;
|
||||
IPluginManager *CPluginManager::GetOldAPI()
|
||||
{
|
||||
return &sOldPluginAPI;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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,11 +45,11 @@ 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);
|
||||
|
||||
for (size_t i = 0; i < sWorkTasks.length(); i++)
|
||||
sWorkTasks[i]();
|
||||
sWorkTasks.clear();
|
||||
}
|
||||
}
|
||||
|
@ -31,10 +31,10 @@
|
||||
|
||||
namespace SourceMod {
|
||||
|
||||
void ScheduleTaskForNextFrame(ke::Lambda<void()>&& task);
|
||||
void ScheduleTaskForNextFrame(ke::Function<void()>&& task);
|
||||
|
||||
void RunScheduledFrameTasks(bool simulating);
|
||||
|
||||
}
|
||||
|
||||
#endif // _include_sourcemod_logic_frame_tasks_h_
|
||||
#endif // _include_sourcemod_logic_frame_tasks_h_
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 83c4441b7ede45dfa447bdef614e924c4b7ffea9
|
||||
Subproject commit 8a59372d1f8333ad455e03866b2aec7769cfb51a
|
@ -1 +1 @@
|
||||
Subproject commit 49f94603972956a85dab61da475e92795ead40a5
|
||||
Subproject commit ee2b9baac39f1e3d1e4c81600beb6b4e1f81323e
|
Loading…
Reference in New Issue
Block a user