diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-06-13 20:19:22 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-06-13 20:23:03 +0800 |
| commit | 8ee8e55ff2b085762dad5ab41269448e7a91757f (patch) | |
| tree | ec1ed6b4944ca1fc4f1adbf67a255912e23a516c /src/command/commandHandler.hpp | |
| parent | 23492ea6f58762914a91516be6a9c180969178a2 (diff) | |
internal: shortened smart pointer types
Diffstat (limited to 'src/command/commandHandler.hpp')
| -rw-r--r-- | src/command/commandHandler.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
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 <any> #include <functional> -#include <memory> +#include "../misc/memory.hpp" #include <netinet/in.h> #include <string> #include <vector> @@ -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<CSession> session) const; - void handleCommand(std::string input, std::shared_ptr<CSession> user = nullptr) const; + SResult newCommand(const std::string &command, const std::string &args, SP<CSession> session) const; + void handleCommand(std::string input, SP<CSession> user = nullptr) const; template <typename T> struct SMakeCommandArgs { @@ -63,9 +63,9 @@ class CCommandHandler { } private: - std::shared_ptr<CCommandHandler::SCommand> getCommand(const std::string &command) const; - SResult exeCommand(const std::shared_ptr<SCommand> command, const std::string &args) const; + SP<CCommandHandler::SCommand> getCommand(const std::string &command) const; + SResult exeCommand(const SP<SCommand> command, const std::string &args) const; - std::vector<std::shared_ptr<SCommand>> m_vCommands; + std::vector<SP<SCommand>> m_vCommands; }; -inline std::unique_ptr<CCommandHandler> g_pCommandHandler; +inline UP<CCommandHandler> g_pCommandHandler; |
