Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

#include <trafficgraphdata.h>

Public Types

enum  GraphRange {
  Range_5m, Range_10m, Range_15m, Range_30m,
  Range_1h, Range_2h, Range_3h, Range_6h,
  Range_12h, Range_24h
}
 
typedef QQueue< TrafficSampleSampleQueue
 
typedef QHash< GraphRange, SampleQueueSampleQueueMap
 

Public Member Functions

 TrafficGraphData (GraphRange range)
 
bool update (const TrafficSample &trafficSample)
 
bool update (quint64 totalBytesRecv, quint64 totalBytesSent)
 
void switchRange (GraphRange newRange)
 
SampleQueue getRangeQueue (GraphRange range)
 
SampleQueue getCurrentRangeQueue ()
 
SampleQueue getCurrentRangeQueueWithAverageBandwidth ()
 
void clear ()
 
void setLastBytes (quint64 nLastBytesIn, quint64 nLastBytesOut)
 
quint64 getLastBytesIn ()
 
quint64 getLastBytesOut ()
 

Static Public Attributes

static const int RangeMinutes [] = {5,10,15,30,60,120,180,360,720,1440}
 
static const int DESIRED_DATA_SAMPLES = 800
 
static const int SMALLEST_SAMPLE_PERIOD
 

Private Member Functions

void update (GraphRange range, const TrafficSample &trafficSample)
 
void tryAddingSampleToStash (GraphRange range)
 
void tryUpdateNextWithLast2Samples (GraphRange range, GraphRange nextRange)
 
void tryUpdateNextWithLast3Samples (GraphRange range, GraphRange nextRange)
 
SampleQueue sumEach2Samples (const SampleQueue &rangeQueue)
 
SampleQueue sumEach3Samples (const SampleQueue &rangeQueue, GraphRange range)
 
float convertSampleToBandwidth (float dataAmount)
 
 TrafficGraphData (const TrafficGraphData &that)
 
TrafficGraphDataoperator= (TrafficGraphData const &)
 

Private Attributes

SampleQueueMap sampleMap
 
SampleQueueMap sampleStash
 
GraphRange currentGraphRange
 
int currentSampleCounter
 
quint64 nLastBytesIn
 
quint64 nLastBytesOut
 

Static Private Attributes

static const int DesiredQueueSizes []
 

Detailed Description

Definition at line 31 of file trafficgraphdata.h.

Member Typedef Documentation

◆ SampleQueue

Definition at line 52 of file trafficgraphdata.h.

◆ SampleQueueMap

Definition at line 53 of file trafficgraphdata.h.

Member Enumeration Documentation

◆ GraphRange

Enumerator
Range_5m 
Range_10m 
Range_15m 
Range_30m 
Range_1h 
Range_2h 
Range_3h 
Range_6h 
Range_12h 
Range_24h 

Definition at line 34 of file trafficgraphdata.h.

Constructor & Destructor Documentation

◆ TrafficGraphData() [1/2]

TrafficGraphData::TrafficGraphData ( GraphRange  range)

Definition at line 21 of file trafficgraphdata.cpp.

◆ TrafficGraphData() [2/2]

TrafficGraphData::TrafficGraphData ( const TrafficGraphData that)
private

Member Function Documentation

◆ clear()

void TrafficGraphData::clear ( )

Definition at line 263 of file trafficgraphdata.cpp.

References currentSampleCounter, nLastBytesIn, nLastBytesOut, and sampleMap.

Referenced by TrafficGraphWidget::clear().

◆ convertSampleToBandwidth()

float TrafficGraphData::convertSampleToBandwidth ( float  dataAmount)
private

◆ getCurrentRangeQueue()

TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueue ( )

Definition at line 232 of file trafficgraphdata.cpp.

References currentGraphRange, DESIRED_DATA_SAMPLES, and getRangeQueue().

◆ getCurrentRangeQueueWithAverageBandwidth()

TrafficGraphData::SampleQueue TrafficGraphData::getCurrentRangeQueueWithAverageBandwidth ( )

◆ getLastBytesIn()

quint64 TrafficGraphData::getLastBytesIn ( )
inline

Definition at line 64 of file trafficgraphdata.h.

References nLastBytesIn.

Referenced by TrafficGraphWidget::paintEvent().

◆ getLastBytesOut()

quint64 TrafficGraphData::getLastBytesOut ( )
inline

Definition at line 65 of file trafficgraphdata.h.

References nLastBytesOut.

Referenced by TrafficGraphWidget::paintEvent().

◆ getRangeQueue()

◆ operator=()

TrafficGraphData& TrafficGraphData::operator= ( TrafficGraphData const &  )
private

◆ setLastBytes()

void TrafficGraphData::setLastBytes ( quint64  nLastBytesIn,
quint64  nLastBytesOut 
)

◆ sumEach2Samples()

TrafficGraphData::SampleQueue TrafficGraphData::sumEach2Samples ( const SampleQueue rangeQueue)
private

Definition at line 134 of file trafficgraphdata.cpp.

Referenced by getRangeQueue().

◆ sumEach3Samples()

TrafficGraphData::SampleQueue TrafficGraphData::sumEach3Samples ( const SampleQueue rangeQueue,
GraphRange  range 
)
private

Definition at line 146 of file trafficgraphdata.cpp.

References DESIRED_DATA_SAMPLES, sampleStash, and sum.

Referenced by getRangeQueue().

◆ switchRange()

void TrafficGraphData::switchRange ( GraphRange  newRange)

Definition at line 128 of file trafficgraphdata.cpp.

References currentGraphRange, and currentSampleCounter.

Referenced by TrafficGraphWidget::setGraphRangeMins().

◆ tryAddingSampleToStash()

void TrafficGraphData::tryAddingSampleToStash ( GraphRange  range)
private

Definition at line 29 of file trafficgraphdata.cpp.

References DesiredQueueSizes, sampleMap, and sampleStash.

Referenced by update().

◆ tryUpdateNextWithLast2Samples()

void TrafficGraphData::tryUpdateNextWithLast2Samples ( GraphRange  range,
GraphRange  nextRange 
)
private

Definition at line 37 of file trafficgraphdata.cpp.

References DesiredQueueSizes, sampleMap, and update().

Referenced by update().

◆ tryUpdateNextWithLast3Samples()

void TrafficGraphData::tryUpdateNextWithLast3Samples ( GraphRange  range,
GraphRange  nextRange 
)
private

Definition at line 45 of file trafficgraphdata.cpp.

References sampleStash, and update().

Referenced by update().

◆ update() [1/3]

bool TrafficGraphData::update ( const TrafficSample trafficSample)

◆ update() [2/3]

bool TrafficGraphData::update ( quint64  totalBytesRecv,
quint64  totalBytesSent 
)

Definition at line 59 of file trafficgraphdata.cpp.

References nLastBytesIn, nLastBytesOut, and update().

◆ update() [3/3]

Member Data Documentation

◆ currentGraphRange

GraphRange TrafficGraphData::currentGraphRange
private

◆ currentSampleCounter

int TrafficGraphData::currentSampleCounter
private

Definition at line 74 of file trafficgraphdata.h.

Referenced by clear(), switchRange(), and update().

◆ DESIRED_DATA_SAMPLES

const int TrafficGraphData::DESIRED_DATA_SAMPLES = 800
static

◆ DesiredQueueSizes

◆ nLastBytesIn

quint64 TrafficGraphData::nLastBytesIn
private

Definition at line 76 of file trafficgraphdata.h.

Referenced by clear(), getLastBytesIn(), setLastBytes(), and update().

◆ nLastBytesOut

quint64 TrafficGraphData::nLastBytesOut
private

Definition at line 77 of file trafficgraphdata.h.

Referenced by clear(), getLastBytesOut(), setLastBytes(), and update().

◆ RangeMinutes

const int TrafficGraphData::RangeMinutes = {5,10,15,30,60,120,180,360,720,1440}
static

◆ sampleMap

SampleQueueMap TrafficGraphData::sampleMap
private

◆ sampleStash

SampleQueueMap TrafficGraphData::sampleStash
private

◆ SMALLEST_SAMPLE_PERIOD

const int TrafficGraphData::SMALLEST_SAMPLE_PERIOD
static

The documentation for this class was generated from the following files:
Released under the MIT license