CorTeX Core ABI 7
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
ctxDebug.h
Go to the documentation of this file.
1//*****************************************************************************
2// File : ctxDebug.h
3// Description : Definition of debug interfaces and utilites
4// Author : Anders Modén
5// Product : CorTeX 2.0.1
6//
7// Copyright © 2015- Anders Modén, Sweden
8//
9// NOTE: CorTeX is a software development kit (SDK)
10// for neural networks and genetic programming.
11// Licensed by Anders Modén.
12//
13//
14// Revision History...
15//
16// Who Date Description
17//
18// AMO 261114 Expose active instrumentation check and instance release (2.0.2)
19// AMO 150708 Created file (1.0.0)
20// AMO 261029 Added hasDebugInstances for flag-gated debug passes (2.0.2)
21//
22//******************************************************************************
23#ifndef __CTX_DEBUG_H__
24#define __CTX_DEBUG_H__
25
26#include "ctxBase.h"
27
30
31//******************************************************************************
32// Class : ctxDebugInterface
33//
34// Purpose : Holds reference count to objects
35//
36// Notes : -
37//
38// Revision History...
39//
40// Who Date Description
41//
42// AMO 160913 Created
43//
44//******************************************************************************
45class CTX_EXPORT ctxDebugInterface : public gzReference
46{
47public:
48
50
53
54 gzVoid setLayerID(ctxDebugInstanceManager *manager, const gzUInt32 &layerID);
56
57 gzVoid setFeature(ctxDebugInstanceManager *manager, const gzUInt32 &featureIndex, const gzUInt32XYZ& featurePosition);
60};
61
62GZ_DECLARE_REFPTR(ctxDebugInterface);
63
64//******************************************************************************
65// Class : ctxDebuggerInterface
66//
67// Purpose : Implements the actual debugger function
68//
69// Notes : -
70//
71// Revision History...
72//
73// Who Date Description
74//
75// AMO 190228 Created
76//
77//******************************************************************************
78class CTX_EXPORT ctxDebuggerInterface : public gzReference
79{
80public:
81
83
84 virtual gzVoid onDebug(ctxDebugInterface *instance, ctxDebugInstanceInfo *info, ctxDebugInstanceManager *manager) = 0;
85};
86
87GZ_DECLARE_REFPTR(ctxDebuggerInterface);
88
89
90// --------------------------------------- ctxDebugInstanceInfo --------------------------------------------
91
92//******************************************************************************
93// Class : ctxDebugInstanceInfo
94//
95// Purpose : Holds intance info for debug client
96//
97// Notes : -
98//
99// Revision History...
100//
101// Who Date Description
102//
103// AMO 160913 Created
104//
105//******************************************************************************
106class ctxDebugInstanceInfo : public gzReference
107{
108public:
109
111 {
112 m_propertyDebugFlags = CTX_DEBUG_OFF;
113 m_propertyFeatureIndex = CTX_UNDEFINED_INDEX;
114 m_propertyFeaturePosition = gzUInt32XYZ(0, 0, 0);
115 m_propertyLayerID = 0;
116 }
117
118 GZ_PROPERTY_EXPORT(ctxDebugFlags, DebugFlags, CTX_EXPORT);
119
120 // Feature mapping
121
122 GZ_PROPERTY_EXPORT(gzUInt32, FeatureIndex, CTX_EXPORT);
123 GZ_PROPERTY_EXPORT(gzUInt32XYZ, FeaturePosition, CTX_EXPORT);
124
125 GZ_PROPERTY_EXPORT(gzUInt32, LayerID, CTX_EXPORT);
126};
127
128// --------------------------------------- ctxDebugInstanceManager --------------------------------------------
129
130//******************************************************************************
131// Class : ctxDebugInstanceManager
132//
133// Purpose : Holds intance info for debug client
134//
135// Notes : -
136//
137// Revision History...
138//
139// Who Date Description
140//
141// AMO 160913 Created
142//
143//******************************************************************************
145{
146public:
147
149
152
153 CTX_EXPORT gzVoid setLayerID(ctxDebugInterface *instance, const gzUInt32 &layerID);
155
156
157 CTX_EXPORT gzVoid setFeature(ctxDebugInterface *instance, const gzUInt32 &featureIndex,const gzUInt32XYZ& featurePosition);
160
162
168
169 CTX_EXPORT gzVoid debug(gzType *type, ctxDebugInterface *instance, ctxDebugInstanceInfo *info);
170
171 CTX_EXPORT gzVoid getOptimizeRegisterKeepLists(gzDynamicArray<gzUInt32>& valueKeepList, gzDynamicArray<gzUInt32>& deltaKeepList);
172
173 CTX_EXPORT gzVoid registerDebugger(gzType *type, ctxDebuggerInterface *debugger);
174 CTX_EXPORT gzVoid unregisterDebugger(gzType *type, ctxDebuggerInterface *debugger);
175
176private:
177
178 gzRefDict<gzInstanceCompareInterface, ctxDebugInstanceInfo> m_instances;
179 gzRefDict<gzInstanceCompareInterface, ctxDebuggerInterface> m_debuggers;
180};
181
182#endif // __CTX_DEBUG_H__
gzVoid unregisterDebugger(gzType *type, ctxDebuggerInterface *debugger)
gzBool hasActiveDebugFlags() const
gzVoid registerDebugger(gzType *type, ctxDebuggerInterface *debugger)
gzVoid clearDebugInstances()
Releases object-address metadata at an explicit realization boundary.
gzVoid debug(gzType *type, ctxDebugInterface *instance, ctxDebugInstanceInfo *info)
ctxDebugFlags getDebugFlags(ctxDebugInterface *instance)
gzUInt32 getLayerID(ctxDebugInterface *instance)
gzUInt32 getFeatureIndex(ctxDebugInterface *instance)
gzVoid setDebugFlags(ctxDebugInterface *instance, const ctxDebugFlags &flags)
gzBool hasDebugInstances() const
Returns TRUE when any instance has registered debug flags, layer or feature state.
gzVoid getOptimizeRegisterKeepLists(gzDynamicArray< gzUInt32 > &valueKeepList, gzDynamicArray< gzUInt32 > &deltaKeepList)
gzVoid setLayerID(ctxDebugInterface *instance, const gzUInt32 &layerID)
gzVoid setFeature(ctxDebugInterface *instance, const gzUInt32 &featureIndex, const gzUInt32XYZ &featurePosition)
gzUInt32XYZ getFeaturePosition(ctxDebugInterface *instance)
GZ_DECLARE_TYPE_INTERFACE
Provides Run Time Type Info (RTTI) for the gzTypeInterface.
Definition ctxDebug.h:49
gzVoid setLayerID(ctxDebugInstanceManager *manager, const gzUInt32 &layerID)
gzUInt32 getFeatureIndex(ctxDebugInstanceManager *manager)
gzUInt32XYZ getFeaturePosition(ctxDebugInstanceManager *manager)
gzVoid setDebugFlags(ctxDebugInstanceManager *manager, const ctxDebugFlags &flags)
gzVoid setFeature(ctxDebugInstanceManager *manager, const gzUInt32 &featureIndex, const gzUInt32XYZ &featurePosition)
ctxDebugFlags getDebugFlags(ctxDebugInstanceManager *manager)
gzUInt32 getLayerID(ctxDebugInstanceManager *manager)
virtual gzVoid onDebug(ctxDebugInterface *instance, ctxDebugInstanceInfo *info, ctxDebugInstanceManager *manager)=0
GZ_DECLARE_TYPE_INTERFACE
Provides Run Time Type Info (RTTI) for the gzTypeInterface.
Definition ctxDebug.h:82
#define CTX_EXPORT
Definition ctxBase.h:68
ctxDebugFlags
Definition ctxTypes.h:47
@ CTX_DEBUG_OFF
Definition ctxTypes.h:48
const gzUInt32 CTX_UNDEFINED_INDEX
Definition ctxTypes.h:35