From 8ee8e55ff2b085762dad5ab41269448e7a91757f Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Fri, 13 Jun 2025 20:19:22 +0800 Subject: internal: shortened smart pointer types --- src/command/commandHandler.cpp | 2 +- src/command/commandHandler.hpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/command') diff --git a/src/command/commandHandler.cpp b/src/command/commandHandler.cpp index 4aa6723..3baeeb1 100644 --- a/src/command/commandHandler.cpp +++ b/src/command/commandHandler.cpp @@ -2,7 +2,7 @@ #include "../debug/log.hpp" #include "../core/session.hpp" #include -#include +#include "../misc/memory.hpp" CCommandHandler::CCommandHandler() { log(LOG, "CommandHandler: initialized"); diff --git a/src/command/commandHandler.hpp b/src/command/commandHandler.hpp index 7fc20d5..5a8636f 100644 --- a/src/command/commandHandler.hpp +++ b/src/command/commandHandler.hpp @@ -3,7 +3,7 @@ #include "../core/session.hpp" #include #include -#include +#include "../misc/memory.hpp" #include #include #include @@ -34,8 +34,8 @@ class CCommandHandler { bool validCommand(const std::string &command) const; // return false if command struct is invalid bool registerCommand(const SCommand &command); - SResult newCommand(const std::string &command, const std::string &args, std::shared_ptr session) const; - void handleCommand(std::string input, std::shared_ptr user = nullptr) const; + SResult newCommand(const std::string &command, const std::string &args, SP session) const; + void handleCommand(std::string input, SP user = nullptr) const; template struct SMakeCommandArgs { @@ -63,9 +63,9 @@ class CCommandHandler { } private: - std::shared_ptr getCommand(const std::string &command) const; - SResult exeCommand(const std::shared_ptr command, const std::string &args) const; + SP getCommand(const std::string &command) const; + SResult exeCommand(const SP command, const std::string &args) const; - std::vector> m_vCommands; + std::vector> m_vCommands; }; -inline std::unique_ptr g_pCommandHandler; +inline UP g_pCommandHandler; -- cgit v1.2.3