ManaPlus
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Private Member Functions
PacketCounters Class Reference

#include <packetcounters.h>

Public Member Functions

 PacketCounters ()
 

Static Public Member Functions

static void incInBytes (const int cnt)
 
static void incInPackets ()
 
static int getInBytes ()
 
static int getInPackets ()
 
static void incOutBytes (const int cnt)
 
static void incOutPackets ()
 
static int getOutBytes ()
 
static int getOutPackets ()
 
static void update ()
 

Static Public Attributes

static int mInCurrentSec = 0
 
static int mInBytes = 0
 
static int mInBytesCalc = 0
 
static int mInPackets = 0
 
static int mInPacketsCalc = 0
 
static int mOutCurrentSec = 0
 
static int mOutBytes = 0
 
static int mOutBytesCalc = 0
 
static int mOutPackets = 0
 
static int mOutPacketsCalc = 0
 

Static Private Member Functions

static void updateCounter (int &currentSec, int &calc, int &counter)
 

Detailed Description

Definition at line 29 of file packetcounters.h.

Constructor & Destructor Documentation

◆ PacketCounters()

PacketCounters::PacketCounters ( )
inline

Definition at line 32 of file packetcounters.h.

33  { }

Member Function Documentation

◆ getInBytes()

int PacketCounters::getInBytes ( )
static

Definition at line 66 of file packetcounters.cpp.

67 {
69 }
static int mInBytesCalc

References mInBytesCalc.

Referenced by NetDebugTab::logic().

◆ getInPackets()

int PacketCounters::getInPackets ( )
static

Definition at line 71 of file packetcounters.cpp.

72 {
74 }
static int mInPacketsCalc

References mInPacketsCalc.

◆ getOutBytes()

int PacketCounters::getOutBytes ( )
static

Definition at line 99 of file packetcounters.cpp.

100 {
102 }
static int mOutBytesCalc

References mOutBytesCalc.

Referenced by NetDebugTab::logic().

◆ getOutPackets()

int PacketCounters::getOutPackets ( )
static

Definition at line 104 of file packetcounters.cpp.

105 {
107 }
static int mOutPacketsCalc

References mOutPacketsCalc.

◆ incInBytes()

void PacketCounters::incInBytes ( const int  cnt)
static

◆ incInPackets()

void PacketCounters::incInPackets ( )
static

◆ incOutBytes()

void PacketCounters::incOutBytes ( const int  cnt)
static

◆ incOutPackets()

void PacketCounters::incOutPackets ( )
static

◆ update()

void PacketCounters::update ( )
static

◆ updateCounter()

void PacketCounters::updateCounter ( int &  currentSec,
int &  calc,
int &  counter 
)
staticprivate

Definition at line 110 of file packetcounters.cpp.

113 {
114  const int idx = CAST_S32(cur_time % 60);
115  if (currentSec != idx)
116  {
117  currentSec = idx;
118  calc = counter;
119  counter = 0;
120  }
121 }
#define CAST_S32
Definition: cast.h:30
volatile time_t cur_time
Definition: timer.cpp:58

References CAST_S32, and cur_time.

Referenced by incInBytes(), incInPackets(), incOutBytes(), incOutPackets(), and update().

Field Documentation

◆ mInBytes

int PacketCounters::mInBytes = 0
static

Definition at line 56 of file packetcounters.h.

Referenced by incInBytes(), and update().

◆ mInBytesCalc

int PacketCounters::mInBytesCalc = 0
static

Definition at line 57 of file packetcounters.h.

Referenced by getInBytes(), incInBytes(), and update().

◆ mInCurrentSec

int PacketCounters::mInCurrentSec = 0
static

Definition at line 55 of file packetcounters.h.

Referenced by incInBytes(), incInPackets(), and update().

◆ mInPackets

int PacketCounters::mInPackets = 0
static

Definition at line 58 of file packetcounters.h.

Referenced by incInPackets(), and update().

◆ mInPacketsCalc

int PacketCounters::mInPacketsCalc = 0
static

Definition at line 59 of file packetcounters.h.

Referenced by getInPackets(), incInPackets(), and update().

◆ mOutBytes

int PacketCounters::mOutBytes = 0
static

Definition at line 61 of file packetcounters.h.

Referenced by incOutBytes(), and update().

◆ mOutBytesCalc

int PacketCounters::mOutBytesCalc = 0
static

Definition at line 62 of file packetcounters.h.

Referenced by getOutBytes(), incOutBytes(), and update().

◆ mOutCurrentSec

int PacketCounters::mOutCurrentSec = 0
static

Definition at line 60 of file packetcounters.h.

Referenced by incOutBytes(), incOutPackets(), and update().

◆ mOutPackets

int PacketCounters::mOutPackets = 0
static

Definition at line 63 of file packetcounters.h.

Referenced by incOutPackets(), and update().

◆ mOutPacketsCalc

int PacketCounters::mOutPacketsCalc = 0
static

Definition at line 64 of file packetcounters.h.

Referenced by getOutPackets(), incOutPackets(), and update().


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