Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-02-04 18:42:05 +0000
committerStijn Buys <ingar@osirion.org>2008-02-04 18:42:05 +0000
commit151a2ac2434f4b4c23c107d9c21e4a18dd1a3c68 (patch)
tree18154b52b44327de28d82ff187f25c8369ddc5d9 /src/core/func.cc
parent09fb43f3d36847977ac202c10c5a11f34af03a43 (diff)
converted client:: singleton classes to namespaces
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
+