1 #ifndef NM_TYPEMANAGER_HPP
2 #define NM_TYPEMANAGER_HPP
4 #include <nmlib/model/moduletype.hpp>
48 bool addUserType(std::unique_ptr<ModuleType> moduleType);
73 unsigned int numBuiltinTypes()
const {
return m_builtinTypes.size(); }
75 unsigned int numUserTypes()
const {
return m_userTypes.size(); }
85 void addBuiltinType(std::unique_ptr<const ModuleType> moduleType);
86 std::vector<std::unique_ptr<ModuleType>> m_userTypes;
87 std::vector<std::unique_ptr<const ModuleType>> m_builtinTypes;
92 #endif // NM_TYPEMANAGER_HPP
Base class for stuff that needs to provide user data in form of a void* pointer.
Definition: userdataprovider.hpp:10
The top-level entity of a noise model. Encapsulates several user types as well as built-in types...
Definition: typemanager.hpp:31
const ModuleType * getType(std::string name) const
Search for a module type with the given name.
Definition: typemanager.cpp:60
ModuleType * createUserType(std::string desiredName)
try to create a new usertype with the given name
Definition: typemanager.cpp:42
signal< void(TypeManager &)> userTypesChanged
This signal is emitted when the list of user type changes.
Definition: typemanager.hpp:82
bool addUserType(std::unique_ptr< ModuleType > moduleType)
Add an existing user type to the TypeManager.
Definition: typemanager.cpp:31
TypeManager()
Creates a new TypeManager.
Definition: typemanager.cpp:17
Describes a recipe for a module and its inputs and outputs.
Definition: moduletype.hpp:37
const ModuleType * getUserType(std::string name) const
Search for a user type with the given name.
Definition: typemanager.cpp:78
void initBuiltinTypes()
Populate the list of built-in module types.
Definition: typemanager.cpp:366
const ModuleType * getBuiltinType(std::string name) const
Search for a built-in type with the given name.
Definition: typemanager.cpp:70
signal< void(TypeManager &)> destroying
This signal is emitted before the TypeManager is destroyed.
Definition: typemanager.hpp:80