Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
CNetStatsTable Class Reference

ENet connection statistics profiler table. More...

#include <NetStats.h>

Inheritance diagram for CNetStatsTable:
Collaboration diagram for CNetStatsTable:

Public Member Functions

 CNetStatsTable ()
 
 CNetStatsTable (const ENetPeer *peer)
 
CStr GetName () override
 GetName: Short descriptive name of this table (should be static). More...
 
CStr GetTitle () override
 GetTitle: Longer, explanatory text (can be dynamic). More...
 
size_t GetNumberRows () override
 GetNumberRows. More...
 
const std::vector< ProfileColumn > & GetColumns () override
 GetColumnDescriptions. More...
 
CStr GetCellText (size_t row, size_t col) override
 GetCellText. More...
 
AbstractProfileTableGetChild (size_t row) override
 GetChild: Return a row's child table if the child is expandable. More...
 
void LatchHostState (const ENetHost *host)
 
- Public Member Functions inherited from AbstractProfileTable
virtual ~AbstractProfileTable ()
 
virtual CStr GetName ()=0
 GetName: Short descriptive name of this table (should be static). More...
 
virtual CStr GetTitle ()=0
 GetTitle: Longer, explanatory text (can be dynamic). More...
 
virtual size_t GetNumberRows ()=0
 GetNumberRows. More...
 
virtual const std::vector< ProfileColumn > & GetColumns ()=0
 GetColumnDescriptions. More...
 
virtual CStr GetCellText (size_t row, size_t col)=0
 GetCellText. More...
 
virtual AbstractProfileTableGetChild (size_t row)=0
 GetChild: Return a row's child table if the child is expandable. More...
 
virtual bool IsHighlightRow (size_t row)
 IsHighlightRow. More...
 

Private Member Functions

 NONCOPYABLE (CNetStatsTable)
 

Private Attributes

const ENetPeerm_Peer
 
std::vector< ProfileColumnm_ColumnDescriptions
 
std::mutex m_Mutex
 
std::vector< std::vector< CStr > > m_LatchedData
 

Detailed Description

ENet connection statistics profiler table.

Thread-safety:

  • Must be constructed in the main thread (to match the profiler).
  • In host mode, the host can be running in a separate thread; call LatchHostState from that thread periodically to safely update our displayed copy of the data.

Constructor & Destructor Documentation

◆ CNetStatsTable() [1/2]

CNetStatsTable::CNetStatsTable ( )

◆ CNetStatsTable() [2/2]

CNetStatsTable::CNetStatsTable ( const ENetPeer peer)

Member Function Documentation

◆ GetCellText()

CStr CNetStatsTable::GetCellText ( size_t  row,
size_t  col 
)
overridevirtual

GetCellText.

Parameters
rowRow index (the first row has index 0).
colColumn index (the first column has index 0).
Returns
Text to be displayed in the given cell.

Implements AbstractProfileTable.

◆ GetChild()

AbstractProfileTable * CNetStatsTable::GetChild ( size_t  row)
overridevirtual

GetChild: Return a row's child table if the child is expandable.

Parameters
rowRow index (the first row has index 0).
Returns
Pointer to the child table if the given row has one. Otherwise, return 0.

Implements AbstractProfileTable.

◆ GetColumns()

const std::vector< ProfileColumn > & CNetStatsTable::GetColumns ( )
overridevirtual

GetColumnDescriptions.

Returns
A vector describing all columns of the table.

Implements AbstractProfileTable.

◆ GetName()

CStr CNetStatsTable::GetName ( )
overridevirtual

GetName: Short descriptive name of this table (should be static).

Returns
Descriptive name of this table.

Implements AbstractProfileTable.

◆ GetNumberRows()

size_t CNetStatsTable::GetNumberRows ( )
overridevirtual

GetNumberRows.

Returns
Number of rows in this table.

Implements AbstractProfileTable.

◆ GetTitle()

CStr CNetStatsTable::GetTitle ( )
overridevirtual

GetTitle: Longer, explanatory text (can be dynamic).

Returns
Title for the table.

Implements AbstractProfileTable.

◆ LatchHostState()

void CNetStatsTable::LatchHostState ( const ENetHost host)

◆ NONCOPYABLE()

CNetStatsTable::NONCOPYABLE ( CNetStatsTable  )
private

Member Data Documentation

◆ m_ColumnDescriptions

std::vector<ProfileColumn> CNetStatsTable::m_ColumnDescriptions
private

◆ m_LatchedData

std::vector<std::vector<CStr> > CNetStatsTable::m_LatchedData
private

◆ m_Mutex

std::mutex CNetStatsTable::m_Mutex
private

◆ m_Peer

const ENetPeer* CNetStatsTable::m_Peer
private

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