3 #ifndef _APIUserCommandManager_H_
4 #define _APIUserCommandManager_H_
8 #include <unordered_map>
10 namespace AnyCAD{
namespace API
23 template<
class TCommand>
26 auto command = std::make_shared<TCommand>();
27 auto itr = m_Commands.find(command->GetName());
28 if (itr != m_Commands.end())
31 return AddCommand(command);
41 std::unordered_map<String, CustomCommandPtr> m_Commands;
44 template<
class TCommand>
56 #define REGISTER_USER_COMMAND(command)\
57 static TCommandRegisger<command> s_register##command;
60 #endif //_APIUserCommandManager_H_
std::shared_ptr< CustomCommand > CustomCommandPtr
Definition: APIUserCommandManager.h:34
static UserCommandManager & Instance()
Definition: APIUserCommandManager.h:45
The user command manager.
Definition: APIUserCommandManager.h:18
bool Register()
Definition: APIUserCommandManager.h:24
TCommandRegisger()
Definition: APIUserCommandManager.h:48