summaryrefslogtreecommitdiff
path: root/src/session.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/session.hpp')
-rw-r--r--src/session.hpp24
1 files changed, 13 insertions, 11 deletions
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 <typename... Args>
- bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args) const;
+ bool write(eFormatType type, std::format_string<Args...> fmt, Args &&...args);
void run();
void setSelf(std::pair<std::jthread, std::shared_ptr<CSession>> *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;
};