OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4GraphCollection Class Reference

#include <C4Network2Stats.h>

Inheritance diagram for C4GraphCollection:
[legend]
Collaboration diagram for C4GraphCollection:
[legend]

Public Types

typedef float ValueType
 
typedef int TimeType
 

Public Member Functions

 C4GraphCollection ()
 
virtual C4Graph::TimeType GetStartTime () const
 
virtual C4Graph::TimeType GetEndTime () const
 
virtual C4Graph::ValueType GetValue (C4Graph::TimeType iAtTime) const
 
virtual C4Graph::ValueType GetMedianValue (C4Graph::TimeType iStartTime, C4Graph::TimeType iEndTime) const
 
virtual C4Graph::ValueType GetMinValue () const
 
virtual C4Graph::ValueType GetMaxValue () const
 
virtual int GetSeriesCount () const
 
virtual const C4GraphGetSeries (int iIndex) const
 
void AddGraph (C4Graph *pAdd)
 
void RemoveGraph (const C4Graph *pRemove)
 
virtual void Update () const
 
virtual void SetAverageTime (int iToTime)
 
virtual void SetMultiplier (ValueType fToVal)
 
void SetTitle (const char *szNewTitle)
 
void SetColorDw (DWORD dwClr)
 
DWORD GetColorDw () const
 
const char * GetTitle () const
 

Detailed Description

Definition at line 129 of file C4Network2Stats.h.

Member Typedef Documentation

typedef int C4Graph::TimeType
inherited

Definition at line 31 of file C4Network2Stats.h.

typedef float C4Graph::ValueType
inherited

Definition at line 30 of file C4Network2Stats.h.

Constructor & Destructor Documentation

C4GraphCollection::C4GraphCollection ( )
inline

Definition at line 136 of file C4Network2Stats.h.

136 : iCommonAvgTime(0), fMultiplier(0) {}

Member Function Documentation

void C4GraphCollection::AddGraph ( C4Graph pAdd)
inline

Definition at line 154 of file C4Network2Stats.h.

References C4Graph::SetAverageTime(), and C4Graph::SetMultiplier().

Referenced by C4Network2Stats::C4Network2Stats().

154 { push_back(pAdd); if (iCommonAvgTime) pAdd->SetAverageTime(iCommonAvgTime); if (fMultiplier) pAdd->SetMultiplier(fMultiplier); }
virtual void SetAverageTime(int iToTime)=0
virtual void SetMultiplier(ValueType fToVal)=0

Here is the call graph for this function:

Here is the caller graph for this function:

DWORD C4Graph::GetColorDw ( ) const
inlineinherited

Definition at line 58 of file C4Network2Stats.h.

Referenced by C4Chart::DrawElement().

58 { return dwColor; }

Here is the caller graph for this function:

C4Graph::TimeType C4GraphCollection::GetEndTime ( ) const
virtual

Implements C4Graph.

Definition at line 239 of file C4Network2Stats.cpp.

240 {
241  const_iterator i = begin(); if (i == end()) return 0;
242  C4Graph::TimeType iTime = (*i)->GetEndTime();
243  while (++i != end()) iTime = std::max(iTime, (*i)->GetEndTime());
244  return iTime;
245 }
C4Graph::ValueType C4GraphCollection::GetMaxValue ( ) const
virtual

Implements C4Graph.

Definition at line 255 of file C4Network2Stats.cpp.

256 {
257  const_iterator i = begin(); if (i == end()) return 0;
258  C4Graph::ValueType iVal = (*i)->GetMaxValue();
259  while (++i != end()) iVal = std::max(iVal, (*i)->GetMaxValue());
260  return iVal;
261 }
float ValueType
virtual C4Graph::ValueType C4GraphCollection::GetMedianValue ( C4Graph::TimeType  iStartTime,
C4Graph::TimeType  iEndTime 
) const
inlinevirtual

Implements C4Graph.

Definition at line 144 of file C4Network2Stats.h.

144 { assert(0); return 0; }
C4Graph::ValueType C4GraphCollection::GetMinValue ( ) const
virtual

Implements C4Graph.

Definition at line 247 of file C4Network2Stats.cpp.

248 {
249  const_iterator i = begin(); if (i == end()) return 0;
250  C4Graph::ValueType iVal = (*i)->GetMinValue();
251  while (++i != end()) iVal = std::min(iVal, (*i)->GetMinValue());
252  return iVal;
253 }
float ValueType
const C4Graph * C4GraphCollection::GetSeries ( int  iIndex) const
virtual

Implements C4Graph.

Definition at line 270 of file C4Network2Stats.cpp.

References iCnt.

271 {
272  for (const_iterator i = begin(); i != end(); ++i)
273  {
274  int iCnt = (*i)->GetSeriesCount();
275  if (iIndex < iCnt) return (*i)->GetSeries(iIndex);
276  iIndex -= iCnt;
277  }
278  return nullptr;
279 }
int iCnt
Definition: TstC4NetIO.cpp:35
int C4GraphCollection::GetSeriesCount ( ) const
virtual

Implements C4Graph.

Definition at line 263 of file C4Network2Stats.cpp.

264 {
265  int iCount = 0;
266  for (const_iterator i = begin(); i != end(); ++i) iCount += (*i)->GetSeriesCount();
267  return iCount;
268 }
C4Graph::TimeType C4GraphCollection::GetStartTime ( ) const
virtual

Implements C4Graph.

Definition at line 231 of file C4Network2Stats.cpp.

232 {
233  const_iterator i = begin(); if (i == end()) return 0;
234  C4Graph::TimeType iTime = (*i)->GetStartTime();
235  while (++i != end()) iTime = std::min(iTime, (*i)->GetStartTime());
236  return iTime;
237 }
const char* C4Graph::GetTitle ( ) const
inlineinherited

Definition at line 59 of file C4Network2Stats.h.

References StdStrBuf::getData().

Referenced by C4Chart::DrawElement().

59 { return szTitle.getData(); }
const char * getData() const
Definition: StdBuf.h:450

Here is the call graph for this function:

Here is the caller graph for this function:

virtual C4Graph::ValueType C4GraphCollection::GetValue ( C4Graph::TimeType  iAtTime) const
inlinevirtual

Implements C4Graph.

Definition at line 143 of file C4Network2Stats.h.

143 { assert(0); return 0; }
void C4GraphCollection::RemoveGraph ( const C4Graph pRemove)
inline

Definition at line 155 of file C4Network2Stats.h.

155 { iterator i=std::find(begin(), end(), pRemove); if (i!=end()) erase(i); }
void C4GraphCollection::SetAverageTime ( int  iToTime)
virtual

Implements C4Graph.

Definition at line 287 of file C4Network2Stats.cpp.

Referenced by C4Network2Stats::C4Network2Stats().

288 {
289  if ((iCommonAvgTime = iToTime))
290  for (iterator i = begin(); i != end(); ++i) (*i)->SetAverageTime(iToTime);
291 }

Here is the caller graph for this function:

void C4Graph::SetColorDw ( DWORD  dwClr)
inlineinherited

Definition at line 42 of file C4Network2Stats.h.

Referenced by C4Network2Stats::C4Network2Stats(), and C4Player::CreateGraphs().

42 { dwColor = dwClr; }

Here is the caller graph for this function:

void C4GraphCollection::SetMultiplier ( ValueType  fToVal)
virtual

Implements C4Graph.

Definition at line 293 of file C4Network2Stats.cpp.

Referenced by C4Network2Stats::ExecuteControlFrame().

294 {
295  if ((fMultiplier = fToVal))
296  for (iterator i = begin(); i != end(); ++i) (*i)->SetMultiplier(fToVal);
297 }

Here is the caller graph for this function:

void C4Graph::SetTitle ( const char *  szNewTitle)
inlineinherited

Definition at line 41 of file C4Network2Stats.h.

References StdStrBuf::Copy().

Referenced by C4Network2Stats::C4Network2Stats(), and C4Player::CreateGraphs().

41 { szTitle.Copy(szNewTitle); }
void Copy()
Definition: StdBuf.h:475

Here is the call graph for this function:

Here is the caller graph for this function:

void C4GraphCollection::Update ( ) const
virtual

Reimplemented from C4Graph.

Definition at line 281 of file C4Network2Stats.cpp.

282 {
283  // update all child graphs
284  for (const_iterator i = begin(); i != end(); ++i) (*i)->Update();
285 }

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