From 151a2ac2434f4b4c23c107d9c21e4a18dd1a3c68 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Mon, 4 Feb 2008 18:42:05 +0000 Subject: converted client:: singleton classes to namespaces --- src/core/func.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/core/func.h') diff --git a/src/core/func.h b/src/core/func.h index 901490e..b3d446f 100644 --- a/src/core/func.h +++ b/src/core/func.h @@ -1,5 +1,5 @@ /* - core/core.h + core/funct.h This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ @@ -10,19 +10,26 @@ #include namespace core { - /// function pointer type - typedef void (* Func)(std::stringstream &args); - /// register a function pointer - void func_register(const char *functionname, Func functionptr); +/// function pointer type +typedef void (* Func)(std::stringstream &args); - /// unregister a function pointer - void func_unregister(std:: string functionname); +/// the function registry +namespace func +{ + /// add a function to the registry + void add(const char *functionname, Func functionptr); + + /// remove a function from the registry + void remove(const char *functionname); + void remove(const std::string &functionname); /// find a fuction pointer /** Returns 0 if the function pointer could not be found */ - Func func_find(std::string functionname); + Func find(const std::string &functionname); +} + } #endif // __INCLUDED_CORE_FUNC_H__ -- cgit v1.2.3