wxArt2D
prflcntmean.cpp
1 /*! \file general/src/prflcntmean.cpp
2  \author Michael Sögtrop
3  \date Created 08/05/2004
4 
5  Copyright: 2004-2004 (c) Michael Sögtrop
6 
7  Licence: wxWidgets Licence
8 
9  RCS-ID: $Id: prflcntmean.cpp,v 1.2 2005/06/27 19:52:43 titato Exp $
10 */
11 
12 ///////////////////////////////////////////////////////////////////////////////
13 //
14 // .h Includedateien
15 // In diesen Dateien darf kein Aufruf von new erfolgen
16 //
17 ///////////////////////////////////////////////////////////////////////////////
18 
19 #include "a2dprec.h"
20 
21 #ifdef __BORLANDC__
22 #pragma hdrstop
23 #endif
24 
25 #ifndef WX_PRECOMP
26 #include "wx/wx.h"
27 #endif
28 
29 #include "wx/genart/prfl.h"
30 
31 #include "wx/genart/prflcntmean.h"
32 
33 ///////////////////////////////////////////////////////////////////////////////
34 //
35 // .inl Includedateien
36 // In diesen Dateien darf kein new Operator deklariert werden
37 //
38 ///////////////////////////////////////////////////////////////////////////////
39 
40 ///////////////////////////////////////////////////////////////////////////////
41 //
42 // Speicherschutz unter Debug fuer Implemenatation
43 //
44 ///////////////////////////////////////////////////////////////////////////////
45 
46 #ifdef _DEBUG
47 #undef THIS_FILE
48 static char THIS_FILE[] = __FILE__;
49 #endif
50 
51 //*****************************************************************************
52 //*
53 //* Klasse a2dProfilerMean: Erzeugungs und Vernichtungsoperatoren
54 //*
55 //*****************************************************************************
56 
57 ///////////////////////////////////////////////////////////////////////////////
58 //
59 // Standard-Erzeugungsoperator
60 //
61 ///////////////////////////////////////////////////////////////////////////////
62 
63 a2dProfilerMean::a2dProfilerMean( wxString idIn )
64  : a2dProfiler( idIn )
65 {
66  cnt = 0;
67  sum = 0;
68  min = 0;
69  max = 0;
70 }
71 
72 ///////////////////////////////////////////////////////////////////////////////
73 //
74 // Vernichtungsoperator
75 //
76 ///////////////////////////////////////////////////////////////////////////////
77 
78 a2dProfilerMean::~a2dProfilerMean ()
79 {
80  OpenPrflFile();
81 
82  if( !prflFile.IsOpened() )
83  return;
84  wxString stro;
85  stro.Printf( wxT( "%-20s|%10d|avg=%12g|max=%12g|min=%12g\n" ),
86  id.c_str(),
87  cnt,
88  sum / cnt,
89  max,
90  min
91  );
92  prflFile.Write( stro );
93 }
94 
95 //*****************************************************************************
96 //*
97 //* Klasse a2dProfilerMean: Zugriffsfunktionen
98 //*
99 //*****************************************************************************
100 
101 //*****************************************************************************
102 //*
103 //* Klasse a2dProfilerMean: Verarbeitungsfunktionen
104 //*
105 //*****************************************************************************
106 
107 //*****************************************************************************
108 //*
109 //* Klasse a2dProfilerMean: interne Funktionen
110 //*
111 //*****************************************************************************
112 
113 //*****************************************************************************
114 //*
115 //* Klasse a2dProfilerMean: statische Variablen
116 //*
117 //*****************************************************************************
static void OpenPrflFile()
opens the profiling data file, if not yet open.
Definition: prfl.cpp:99
profiling classes
profiling classes
prflcntmean.cpp Source File -- Sun Oct 12 2014 17:04:23 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation