ndmspc v1.2.0-0.1.rc5
Loading...
Searching...
No Matches
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.
 
ULong_t GetWsId () const
 Get the WebSocket client ID.
 
const std::string & GetUsername () const
 Get the username of the client.
 
int GetMessageCount () const
 Get the message count for the client.
 
std::chrono::system_clock::time_point GetConnectedAt () const
 Get the connection start time for the client.
 
void SetUsername (const std::string &username)
 Set the username for the client.
 
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() [1/2]

Ndmspc::NWsClientInfo::NWsClientInfo ( )

Default constructor.

Definition at line 6 of file NWsClientInfo.cxx.

References fConnectedAt, fMessageCount, fUsername, and fWsId.

◆ NWsClientInfo() [2/2]

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.

References fConnectedAt, fMessageCount, fUsername, and fWsId.

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.

◆ IncrementMessageCount()

void Ndmspc::NWsClientInfo::IncrementMessageCount ( )

Increment the message count for the client.

Definition at line 45 of file NWsClientInfo.cxx.

References fMessageCount.

◆ 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.

Member Data Documentation

◆ fConnectedAt

std::chrono::system_clock::time_point Ndmspc::NWsClientInfo::fConnectedAt
private

Connection start time.

Definition at line 21 of file NWsClientInfo.h.

Referenced by GetConnectedAt(), NWsClientInfo(), and NWsClientInfo().

◆ fMessageCount

int Ndmspc::NWsClientInfo::fMessageCount
private

Number of messages sent/received.

Definition at line 20 of file NWsClientInfo.h.

Referenced by GetMessageCount(), IncrementMessageCount(), NWsClientInfo(), and NWsClientInfo().

◆ fUsername

std::string Ndmspc::NWsClientInfo::fUsername
private

Username associated with the client.

Definition at line 19 of file NWsClientInfo.h.

Referenced by GetUsername(), NWsClientInfo(), NWsClientInfo(), and SetUsername().

◆ fWsId

ULong_t Ndmspc::NWsClientInfo::fWsId
private

Unique WebSocket client ID.

Definition at line 18 of file NWsClientInfo.h.

Referenced by GetWsId(), NWsClientInfo(), and NWsClientInfo().


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