gwnavruntime/visualdebug/internal/visualdebugstat.h Source File

visualdebugstat.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 // primary contact: BRGR - secondary contact: NOBODY
9 #ifndef Navigation_VisualDebugStat_H
10 #define Navigation_VisualDebugStat_H
11 
12 
18 
19 
20 namespace Kaim
21 {
22 
23 class VisualDebugStats
24 {
25 public:
26  VisualDebugStats(const char* name, KyFloat32 current, KyFloat32 average, KyFloat32 max, KyFloat32 min)
27  : m_name(name), m_current(current), m_average(average), m_max(max), m_min(min) {}
28 
29 public:
30  String m_name;
31  KyFloat32 m_current;
32  KyFloat32 m_average;
33  KyFloat32 m_max;
34  KyFloat32 m_min;
35 };
36 
37 class VisualDebugSingleUInt32
38 {
39 public:
40  VisualDebugSingleUInt32(const char* name, KyUInt32 value)
41  : m_name(name), m_value(value)
42  {}
43 
44 public:
45  String m_name;
46  KyUInt32 m_value;
47 };
48 
49 class VisualDebugSingleInt32
50 {
51 public:
52  VisualDebugSingleInt32(const char* name, KyInt32 value)
53  : m_name(name), m_value(value) {}
54 
55 public:
56  String m_name;
57  KyInt32 m_value;
58 };
59 
60 class VisualDebugSingleFloat32
61 {
62 public:
63  VisualDebugSingleFloat32(const char* name, KyFloat32 value)
64  : m_name(name), m_value(value) {}
65 
66 public:
67  String m_name;
68  KyFloat32 m_value;
69 };
70 
71 
72 class VisualDebugSingleString
73 {
74 public:
75  VisualDebugSingleString(const char* name, const char* value)
76  : m_name(name), m_value(value) {}
77 
78  String m_name;
79  String m_value;
80 };
81 
82 class VisualDebugStatGroup
83 {
84  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_VisualDebug)
85 public:
86  VisualDebugStatGroup() : m_name("") {}
87 
88  VisualDebugStatGroup(const char* name) : m_name(name) {}
89 
90  void AddUInt32(const char* statName, KyUInt32 value)
91  { m_singleUInt32.PushBack(VisualDebugSingleUInt32(statName, value)); }
92 
93  void AddInt32(const char* statName, KyInt32 value)
94  { m_singleInt32.PushBack(VisualDebugSingleInt32(statName, value)); }
95 
96  void AddFloat32(const char* statName, KyFloat32 value)
97  { m_singleFloat32.PushBack(VisualDebugSingleFloat32(statName, value)); }
98 
99  void AddString(const char* statName, String value)
100  { m_singleString.PushBack(VisualDebugSingleString(statName, value)); }
101 
102  void AddStats(const char* statName, const KyFloat32 value, const KyFloat32 average, const KyFloat32 max, const KyFloat32 min)
103  { m_stats.PushBack(VisualDebugStats(statName, value, average, max, min)); }
104 
105  void Map(BlobFieldsMapping& mapping);
106 
107 public:
108  String m_name;
109  KyArray<VisualDebugStats> m_stats;
110  KyArray<VisualDebugSingleUInt32> m_singleUInt32;
111  KyArray<VisualDebugSingleInt32> m_singleInt32;
112  KyArray<VisualDebugSingleFloat32> m_singleFloat32;
113  KyArray<VisualDebugSingleString> m_singleString;
114 };
115 
116 
117 class SentBlobTypeStats
118 {
119  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_VisualDebug)
120 public:
121  SentBlobTypeStats(const char* name);
122 
123  void Clear();
124 
125  void OnSend(KyUInt32 sendSize);
126 
127  void SetMinMax( KyUInt32 sendSize );
128 
129  KyUInt32 m_sentSizeInOctets;
130  KyUInt32 m_sentCount;
131  KyUInt32 m_averageSize;
132  KyUInt32 m_minSize;
133  KyUInt32 m_maxSize;
134  BlobMultiField32Mapping m_statMapping;
135 };
136 
137 
138 }
139 
140 #endif
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43