gwnavruntime/visualdebug/internal/visualdebugstat.h Source File

visualdebugstat.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
9 
10 
16 
17 
18 namespace Kaim
19 {
20 
21 class VisualDebugStats
22 {
23 public:
24  VisualDebugStats(const char* name, KyFloat32 current, KyFloat32 average, KyFloat32 max, KyFloat32 min)
25  : m_name(name), m_current(current), m_average(average), m_max(max), m_min(min) {}
26 
27 public:
28  String m_name;
29  KyFloat32 m_current;
30  KyFloat32 m_average;
31  KyFloat32 m_max;
32  KyFloat32 m_min;
33 };
34 
35 class VisualDebugSingleUInt32
36 {
37 public:
38  VisualDebugSingleUInt32(const char* name, KyUInt32 value)
39  : m_name(name), m_value(value)
40  {}
41 
42 public:
43  String m_name;
44  KyUInt32 m_value;
45 };
46 
47 class VisualDebugSingleInt32
48 {
49 public:
50  VisualDebugSingleInt32(const char* name, KyInt32 value)
51  : m_name(name), m_value(value) {}
52 
53 public:
54  String m_name;
55  KyInt32 m_value;
56 };
57 
58 class VisualDebugSingleFloat32
59 {
60 public:
61  VisualDebugSingleFloat32(const char* name, KyFloat32 value)
62  : m_name(name), m_value(value) {}
63 
64 public:
65  String m_name;
66  KyFloat32 m_value;
67 };
68 
69 
70 class VisualDebugSingleString
71 {
72 public:
73  VisualDebugSingleString(const char* name, const char* value)
74  : m_name(name), m_value(value) {}
75 
76  String m_name;
77  String m_value;
78 };
79 
80 class VisualDebugStatGroup
81 {
82  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_VisualDebug)
83 public:
84  VisualDebugStatGroup() : m_name("") {}
85 
86  VisualDebugStatGroup(const char* name) : m_name(name) {}
87 
88  void AddUInt32(const char* statName, KyUInt32 value)
89  { m_singleUInt32.PushBack(VisualDebugSingleUInt32(statName, value)); }
90 
91  void AddInt32(const char* statName, KyInt32 value)
92  { m_singleInt32.PushBack(VisualDebugSingleInt32(statName, value)); }
93 
94  void AddFloat32(const char* statName, KyFloat32 value)
95  { m_singleFloat32.PushBack(VisualDebugSingleFloat32(statName, value)); }
96 
97  void AddString(const char* statName, String value)
98  { m_singleString.PushBack(VisualDebugSingleString(statName, value)); }
99 
100  void AddStats(const char* statName, const KyFloat32 value, const KyFloat32 average, const KyFloat32 max, const KyFloat32 min)
101  { m_stats.PushBack(VisualDebugStats(statName, value, average, max, min)); }
102 
103  void Map(BlobFieldsMapping& mapping);
104 
105 public:
106  String m_name;
107  KyArray<VisualDebugStats> m_stats;
108  KyArray<VisualDebugSingleUInt32> m_singleUInt32;
109  KyArray<VisualDebugSingleInt32> m_singleInt32;
110  KyArray<VisualDebugSingleFloat32> m_singleFloat32;
111  KyArray<VisualDebugSingleString> m_singleString;
112 };
113 
114 
115 class SentBlobTypeStats
116 {
117  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_VisualDebug)
118 public:
119  SentBlobTypeStats(const char* name);
120 
121  void Clear();
122 
123  void OnSend(KyUInt32 sendSize);
124 
125  void SetMinMax( KyUInt32 sendSize );
126 
127  KyUInt32 m_sentSizeInOctets;
128  KyUInt32 m_sentCount;
129  KyUInt32 m_averageSize;
130  KyUInt32 m_minSize;
131  KyUInt32 m_maxSize;
132  BlobMultiField32Mapping m_statMapping;
133 };
134 
135 
136 }
137 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
std::int32_t KyInt32
int32_t
Definition: types.h:24
float KyFloat32
float
Definition: types.h:32