// Author: Andreas F. Borchert
// Description: register functions by their name #ifndef DYNFUNCTION_REGISTRY_HPP #define DYNFUNCTION_REGISTRY_HPP #include <map> #include <string> #include "Function.hpp" class DynFunctionRegistry { public: // constructors DynFunctionRegistry(); DynFunctionRegistry(const std::string& dir); void add(Function* f); bool is_known(const std::string& fname); Function* get_function(const std::string& fname); private: const std::string dir; std::map< std::string, Function* > registry; Function* dynload(const std::string& fname); }; // class DynFunctionRegistry #endif |