Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/func.cc')
-rw-r--r--src/core/func.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/core/func.cc b/src/core/func.cc
index b89e556..bcc6f50 100644
--- a/src/core/func.cc
+++ b/src/core/func.cc
@@ -6,25 +6,37 @@
#include "core/func.h"
#include <map>
+#include <string>
namespace core
{
-std::map<std::string, Func> functionmap;
+namespace func
+{
+
+std::map<std::string, Func> registry;
-void func_register(const char * functionname, Func functionptr)
+void add(const char * functionname, Func functionptr)
{
- functionmap[std::string(functionname)] = functionptr;
+ registry[std::string(functionname)] = functionptr;
}
-void func_unregister(std:: string functionname)
+void remove(const char *functionname)
{
- functionmap.erase(std::string(functionname));
+ registry.erase(std::string(functionname));
}
-Func func_find(std::string functionname)
+void remove(const std::string &functionname)
{
- return functionmap[functionname];
+ registry.erase(functionname);
}
+Func find(const std::string &functionname)
+{
+ return registry[functionname];
+}
+
+} // namespace func
+
} // namespace core
+