ndmspc  v1.2.0-0.1.rc3
NWsClientInfo.cxx
1 #include "NWsClientInfo.h" // Include header from within its namespace
2 
3 namespace Ndmspc {
4 
5 // Default constructor implementation
7  : fWsId(0), fUsername(""), fMessageCount(0), fConnectedAt(std::chrono::system_clock::now())
8 {
9 }
10 
11 // Constructor with initial values implementation
12 NWsClientInfo::NWsClientInfo(ULong_t id, const std::string & username)
13  : fWsId(id), fUsername(username), fMessageCount(0), fConnectedAt(std::chrono::system_clock::now())
14 {
15 }
16 
17 // Getters implementation
18 ULong_t NWsClientInfo::GetWsId() const
19 {
20  return fWsId;
21 }
22 const std::string & NWsClientInfo::GetUsername() const
23 {
24  return fUsername;
25 }
27 {
28  return fMessageCount;
29 }
30 
31 std::chrono::system_clock::time_point NWsClientInfo::GetConnectedAt() const
32 {
33  return fConnectedAt;
34 }
35 
36 
37 // Setter for username implementation
38 void NWsClientInfo::SetUsername(const std::string & username)
39 {
40  fUsername = username;
41 }
42 
43 
44 // Method to increment message count implementation
46 {
47  fMessageCount++;
48 }
49 
50 
51 } // namespace Ndmspc
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.