KiCad PCB EDA Suite
COBJECT3D_STATS Class Reference

Implements a class for object statistics using Singleton pattern. More...

#include <cobject.h>

Public Member Functions

void ResetStats ()
 
unsigned int GetCountOf (OBJECT3D_TYPE aObjType) const
 
void AddOne (OBJECT3D_TYPE aObjType)
 
void PrintStats ()
 

Static Public Member Functions

static COBJECT3D_STATSInstance ()
 

Private Member Functions

 COBJECT3D_STATS ()
 
 COBJECT3D_STATS (const COBJECT3D_STATS &old)
 
const COBJECT3D_STATSoperator= (const COBJECT3D_STATS &old)
 
 ~COBJECT3D_STATS ()
 

Private Attributes

unsigned int m_counter [OBJ3D_MAX]
 

Static Private Attributes

static COBJECT3D_STATSs_instance = 0
 

Detailed Description

Implements a class for object statistics using Singleton pattern.

Definition at line 102 of file cobject.h.

Constructor & Destructor Documentation

COBJECT3D_STATS::COBJECT3D_STATS ( )
inlineprivate

Definition at line 125 of file cobject.h.

References ResetStats().

Referenced by Instance().

125 { ResetStats(); }
void ResetStats()
Definition: cobject.h:106
COBJECT3D_STATS::COBJECT3D_STATS ( const COBJECT3D_STATS old)
private
COBJECT3D_STATS::~COBJECT3D_STATS ( )
inlineprivate

Definition at line 128 of file cobject.h.

128 {}

Member Function Documentation

void COBJECT3D_STATS::AddOne ( OBJECT3D_TYPE  aObjType)
inline

Definition at line 112 of file cobject.h.

References m_counter.

Referenced by COBJECT::COBJECT().

112 { m_counter[aObjType]++; }
unsigned int m_counter[OBJ3D_MAX]
Definition: cobject.h:131
unsigned int COBJECT3D_STATS::GetCountOf ( OBJECT3D_TYPE  aObjType) const
inline

Definition at line 110 of file cobject.h.

References m_counter.

110 { return m_counter[aObjType]; }
unsigned int m_counter[OBJ3D_MAX]
Definition: cobject.h:131
static COBJECT3D_STATS& COBJECT3D_STATS::Instance ( )
inlinestatic

Definition at line 116 of file cobject.h.

References COBJECT3D_STATS(), and s_instance.

Referenced by COBJECT::COBJECT(), and C3D_RENDER_RAYTRACING::reload().

117  {
118  if( !s_instance )
120 
121  return *s_instance;
122  }
static COBJECT3D_STATS * s_instance
Definition: cobject.h:133
const COBJECT3D_STATS& COBJECT3D_STATS::operator= ( const COBJECT3D_STATS old)
private
void COBJECT3D_STATS::PrintStats ( )

Definition at line 57 of file cobject.cpp.

References m_counter, OBJ3D_MAX, and OBJECT3D_STR.

Referenced by C3D_RENDER_RAYTRACING::reload().

58 {
59  printf( "OBJ3D Statistics:\n" );
60 
61  for( unsigned int i = 0; i < OBJ3D_MAX; ++i )
62  {
63  printf( " %20s %u\n", OBJECT3D_STR[i], m_counter[i] );
64  }
65 }
static const char * OBJECT3D_STR[OBJ3D_MAX]
Definition: cobject.cpp:46
unsigned int m_counter[OBJ3D_MAX]
Definition: cobject.h:131
void COBJECT3D_STATS::ResetStats ( )
inline

Definition at line 106 of file cobject.h.

References m_counter, and OBJ3D_MAX.

Referenced by COBJECT3D_STATS(), and C3D_RENDER_RAYTRACING::reload().

106  { memset( m_counter,
107  0,
108  sizeof( unsigned int ) * OBJ3D_MAX ); }
unsigned int m_counter[OBJ3D_MAX]
Definition: cobject.h:131

Member Data Documentation

unsigned int COBJECT3D_STATS::m_counter[OBJ3D_MAX]
private

Definition at line 131 of file cobject.h.

Referenced by AddOne(), GetCountOf(), PrintStats(), and ResetStats().

COBJECT3D_STATS * COBJECT3D_STATS::s_instance = 0
staticprivate

Definition at line 133 of file cobject.h.

Referenced by Instance().


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