From 458d92bd4f7bcc61a3ccb1467d5767bd8daceff2 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 9 Mar 2025 13:29:24 +0800 Subject: style: remove random const, reorganize stuff --- src/session.hpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/session.hpp') diff --git a/src/session.hpp b/src/session.hpp index d5fb7e6..669da18 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -8,20 +8,22 @@ class CSession { public: + CSession(Hyprutils::OS::CFileDescriptor m_sockfd); + ~CSession(); + struct SRecvData { char data[1024] = {0}; ssize_t dataSize = sizeof(data); bool good = true; }; - CSession(Hyprutils::OS::CFileDescriptor m_sockfd); - ~CSession(); - std::string getName() const; - bool isValid() const; + + std::string getName(); + bool isValid(); SRecvData read(); SRecvData read(const std::string &msg); - bool write(const std::string &msg, eFormatType type) const; + bool write(const std::string &msg, eFormatType type); template - bool write(eFormatType type, std::format_string fmt, Args &&...args) const; + bool write(eFormatType type, std::format_string fmt, Args &&...args); void run(); void setSelf(std::pair> *self); @@ -35,10 +37,10 @@ class CSession { std::string m_name; void recvManager(); bool registerSession(); - void onConnect() const; - void onDisconnect() const; - void onErrno(eEventType) const; - void onRecv(const SRecvData &data) const; - void onSend(const std::string &msg) const; + void onConnect(); + void onDisconnect(); + void onErrno(eEventType); + void onRecv(const SRecvData &data); + void onSend(const std::string &msg); friend class CSessionManager; }; -- cgit v1.2.3