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/core/session.hpp | |
| parent | 23492ea6f58762914a91516be6a9c180969178a2 (diff) | |
internal: shortened smart pointer types
Diffstat (limited to 'src/core/session.hpp')
| -rw-r--r-- | src/core/session.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/session.hpp b/src/core/session.hpp index ca951d1..9a953fc 100644 --- a/src/core/session.hpp +++ b/src/core/session.hpp @@ -4,7 +4,7 @@ #include "chatManager.hpp" #include "../debug/format.hpp" #include <format> -#include <memory> +#include "../misc/memory.hpp" #include <netinet/in.h> #include <optional> #include <string> @@ -31,8 +31,8 @@ class CSession { const std::string &getIp() const; bool isAdmin() const; - std::unique_ptr<SRecvData> read(); - std::unique_ptr<SRecvData> read(const std::string &msg, bool bypassDeaf = false); + UP<SRecvData> read(); + UP<SRecvData> read(const std::string &msg, bool bypassDeaf = false); bool write(const std::string &msg); template <typename... Args> bool write(std::format_string<Args...> fmt, Args &&...args); @@ -57,8 +57,8 @@ class CSession { WRITE }; - std::weak_ptr<CSession> self; - std::shared_ptr<CFileDescriptor> m_sockfd; + WP<CSession> self; + SP<CFileDescriptor> m_sockfd; sockaddr_in m_addr; socklen_t m_addrLen = sizeof(m_addr); std::string m_name; |
