18 class SentBlobTypeStats;
19 class VisualDebugServer;
21 enum VisualDebugStatType
23 VisualDebugStatType_UInt = Kaim::BlobField32::Type_KyUInt32,
24 VisualDebugStatType_Int = Kaim::BlobField32::Type_KyInt32,
25 VisualDebugStatType_Float = Kaim::BlobField32::Type_KyFloat32,
26 VisualDebugStatType_String
29 class VisualDebugAttributeHeader
33 VisualDebugAttributeHeader(const
char* name) : m_name(name) {}
39 class VisualDebugAttributeValues
43 VisualDebugAttributeValues(
KyUInt32 value32Count)
45 m_values32.Resize(value32Count);
46 for (UPInt i = 0; i < value32Count; ++i)
50 void AddInt32Value(
KyInt32 val) { m_values32.PushBack(*(
KyUInt32*)&val); }
51 void AddUInt32Value(
KyUInt32 val) { m_values32.PushBack(val); }
52 void AddValue32(
KyUInt32 val) { m_values32.PushBack(val); }
55 void SetStringValue(
const char* val) { m_stringValue = val; }
56 void SetInt32Value(
KyInt32 val,
KyUInt32 idx = 0) {
if (OutOfValuesBound(idx) ==
false) m_values32[idx] = *(
KyUInt32*)&val; }
57 void SetUInt32Value(
KyUInt32 val,
KyUInt32 idx = 0) {
if (OutOfValuesBound(idx) ==
false) m_values32[idx] = val; }
58 void SetValue32(
KyUInt32 val,
KyUInt32 idx = 0) {
if (OutOfValuesBound(idx) ==
false) m_values32[idx] = val; }
61 const String& GetStringValue()
const {
return m_stringValue; }
62 KyInt32 GetInt32Value(
KyUInt32 idx)
const {
if (OutOfValuesBound(idx))
return 0;
else return *(
KyInt32*)(&m_values32[idx]); }
63 KyUInt32 GetUInt32Value(
KyUInt32 idx)
const {
if (OutOfValuesBound(idx))
return 0;
else return m_values32[idx]; }
67 bool OutOfValuesBound(
KyUInt32 valueIndex)
const
69 KY_ASSERT(valueIndex < m_values32.GetSize());
70 if (valueIndex < m_values32.GetSize())
78 KyArray<KyUInt32> m_values32;
81 class VisualDebugAttribute
85 VisualDebugAttribute() : m_name(""), m_valueType(VisualDebugStatType_UInt) {}
87 VisualDebugAttribute(
const char* name) : m_name(name) {}
90 VisualDebugStatType m_valueType;
91 VisualDebugAttributeValues* m_values;
92 VisualDebugAttributeHeader* m_header;
112 VisualDebugAttributeHeader* GetOrCreateHeader(
const char* headerName);
116 VisualDebugAttribute* CreateFloatStatAttribute (
const char* name,
KyUInt32 statValueEnum);
117 VisualDebugAttribute* CreateSentItemsAttribute(
const char* name,
KyUInt32 statValueEnum);
118 VisualDebugAttribute* CreateIntAttribute (
const char* name,
KyUInt32 statValueEnum,
KyUInt32 valueCount = 1, VisualDebugAttributeHeader* header =
nullptr);
119 VisualDebugAttribute* CreateUIntAttribute(
const char* name,
KyUInt32 statValueEnum,
KyUInt32 valueCount = 1, VisualDebugAttributeHeader* header =
nullptr);
120 VisualDebugAttribute* CreateStringAttribute(
const char* name,
KyUInt32 statValueEnum, VisualDebugAttributeHeader* header =
nullptr);
128 void UpdateSentItemsValues(
KyUInt32 valEnum,
const SentBlobTypeStats& stats);
136 void SetDescriptionSent(
bool descriptionSent) { m_descriptionSent = descriptionSent; }
145 VisualDebugAttribute* CreateStatItem(
const char* name, VisualDebugAttributeValues* statValue, VisualDebugStatType type
146 ,
KyUInt32 statValueEnum, VisualDebugAttributeHeader* header);
150 KyArray<VisualDebugAttribute*> m_items;
151 KyArray<VisualDebugAttributeValues*> m_itemsValues;
152 KyArray<VisualDebugAttributeHeader*> m_headers;
153 bool m_descriptionSent;
void SendGroupValues(VisualDebugServer *visualDebugServer)
Send the group values (items' values only)
Definition: visualdebugattributes.cpp:174
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
VisualDebugAttribute * CreateFloatAttribute(const char *name, KyUInt32 statValueEnum, KyUInt32 valueCount=1, VisualDebugAttributeHeader *header=nullptr)
Call these to build your stat group.
Definition: visualdebugattributes.cpp:124
void UpdateStringValue(KyUInt32 valEnum, const char *val)
Call this to update your stat group.
Definition: visualdebugattributes.cpp:81
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
void SendGroupDescription(VisualDebugServer *visualDebugServer)
Send the group description (items' names, types, headers)
Definition: visualdebugattributes.cpp:165
A group of Key / valuetype / arrayof values, where the keys and types are created once...
Definition: visualdebugattributes.h:101
FloatStat maintains current, average, min, max statistics in a sliding window of frames.
Definition: floatstat.h:19
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
std::int32_t KyInt32
int32_t
Definition: types.h:24
bool IsDescriptionSent()
The decription must be sent only once on creation or on reconnection.
Definition: visualdebugattributes.h:135
float KyFloat32
float
Definition: types.h:32