ndmspc  v1.2.0-0.1.rc3
NWsClientInfo.h
1 #ifndef NDMSPC_NWS_CLIENT_INFO_H
2 #define NDMSPC_NWS_CLIENT_INFO_H
3 
4 #include <string> // For std::string
5 #include <chrono> // For std::chrono::system_clock
6 #include "Rtypes.h" // For ULong_t
7 
8 namespace Ndmspc {
9 
17  private:
18  ULong_t fWsId;
19  std::string fUsername;
21  std::chrono::system_clock::time_point fConnectedAt;
22 
23  public:
27  NWsClientInfo();
28 
34  NWsClientInfo(ULong_t id, const std::string & username);
35 
40  ULong_t GetWsId() const;
41 
46  const std::string & GetUsername() const;
47 
52  int GetMessageCount() const;
53 
58  std::chrono::system_clock::time_point GetConnectedAt() const;
59 
64  void SetUsername(const std::string & username);
65 
69  void IncrementMessageCount();
70 
71 };
72 
73 } // namespace Ndmspc
74 
75 #endif // NDMSPC_NWS_CLIENT_INFO_H
Holds per-client data for WebSocket connections.
Definition: NWsClientInfo.h:16
std::string fUsername
Username associated with the client.
Definition: NWsClientInfo.h:19
ULong_t GetWsId() const
Get the WebSocket client ID.
int GetMessageCount() const
Get the message count for the client.
NWsClientInfo()
Default constructor.
ULong_t fWsId
Unique WebSocket client ID.
Definition: NWsClientInfo.h:18
std::chrono::system_clock::time_point GetConnectedAt() const
Get the connection start time for the client.
std::chrono::system_clock::time_point fConnectedAt
Connection start time.
Definition: NWsClientInfo.h:21
const std::string & GetUsername() const
Get the username of the client.
void SetUsername(const std::string &username)
Set the username for the client.
int fMessageCount
Number of messages sent/received.
Definition: NWsClientInfo.h:20
void IncrementMessageCount()
Increment the message count for the client.