TorqueScript  0.2
functionregistry.hpp
1 
15 #pragma once
16 
17 #include <string>
18 #include <memory>
19 #include <unordered_map>
20 
21 #include <torquescript/function.hpp>
22 
23 namespace TorqueScript
24 {
33  {
38  FunctionRegistry(const std::string& package) : mPackageName(package), mActive(false)
39  {
40 
41  }
42 
44  std::string mPackageName;
45 
47  bool mActive;
48 
50  std::unordered_map<std::string, std::unordered_map<std::string, std::shared_ptr<Function>>> mFunctions;
51  };
52 }
Definition: ast.hpp:28
A FunctionRegistry is used to keep track of registered functions in memory by the packages they are a...
Definition: functionregistry.hpp:33
std::string mPackageName
The package this registry belongs to.
Definition: functionregistry.hpp:44
bool mActive
Whether or not the registry is currently active.
Definition: functionregistry.hpp:47
std::unordered_map< std::string, std::unordered_map< std::string, std::shared_ptr< Function > > > mFunctions
A mapping of function namespaces to a mapping of function names to the function object.
Definition: functionregistry.hpp:50
FunctionRegistry(const std::string &package)
Constructs a new FunctionRegistry instance.
Definition: functionregistry.hpp:38