ndmspc  v1.2.0-0.1.rc3
Ndmspc::NWsClientInfo Class Reference

Holds per-client data for WebSocket connections. More...

#include <NWsClientInfo.h>

Public Member Functions

 NWsClientInfo ()
 Default constructor.
 
 NWsClientInfo (ULong_t id, const std::string &username)
 Constructor with initial values. More...
 
ULong_t GetWsId () const
 Get the WebSocket client ID. More...
 
const std::string & GetUsername () const
 Get the username of the client. More...
 
int GetMessageCount () const
 Get the message count for the client. More...
 
std::chrono::system_clock::time_point GetConnectedAt () const
 Get the connection start time for the client. More...
 
void SetUsername (const std::string &username)
 Set the username for the client. More...
 
void IncrementMessageCount ()
 Increment the message count for the client.
 

Private Attributes

ULong_t fWsId
 Unique WebSocket client ID.
 
std::string fUsername
 Username associated with the client.
 
int fMessageCount
 Number of messages sent/received.
 
std::chrono::system_clock::time_point fConnectedAt
 Connection start time.
 

Detailed Description

Holds per-client data for WebSocket connections.

Stores client ID, username, and message count for tracking individual clients.

Definition at line 16 of file NWsClientInfo.h.

Constructor & Destructor Documentation

◆ NWsClientInfo()

Ndmspc::NWsClientInfo::NWsClientInfo ( ULong_t  id,
const std::string &  username 
)

Constructor with initial values.

Parameters
idWebSocket client ID.
usernameUsername for the client.

Definition at line 12 of file NWsClientInfo.cxx.

Member Function Documentation

◆ GetConnectedAt()

std::chrono::system_clock::time_point Ndmspc::NWsClientInfo::GetConnectedAt ( ) const

Get the connection start time for the client.

Returns
Connection start time.

Definition at line 31 of file NWsClientInfo.cxx.

References fConnectedAt.

◆ GetMessageCount()

int Ndmspc::NWsClientInfo::GetMessageCount ( ) const

Get the message count for the client.

Returns
Number of messages.

Definition at line 26 of file NWsClientInfo.cxx.

References fMessageCount.

◆ GetUsername()

const std::string & Ndmspc::NWsClientInfo::GetUsername ( ) const

Get the username of the client.

Returns
Username string.

Definition at line 22 of file NWsClientInfo.cxx.

References fUsername.

◆ GetWsId()

ULong_t Ndmspc::NWsClientInfo::GetWsId ( ) const

Get the WebSocket client ID.

Returns
Client ID.

Definition at line 18 of file NWsClientInfo.cxx.

References fWsId.

◆ SetUsername()

void Ndmspc::NWsClientInfo::SetUsername ( const std::string &  username)

Set the username for the client.

Parameters
usernameNew username.

Definition at line 38 of file NWsClientInfo.cxx.

References fUsername.


The documentation for this class was generated from the following files: