CorTeX
Core ABI 7
ToolTech Software · C++ library reference
ToolTech
CorTeX overview
Programmer’s manual
Class reference
Change history
CycloPos ↗
Toggle main menu visibility
Loading...
Searching...
No Matches
include
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
28
class
ctxDebugInstanceManager
;
29
class
ctxDebugInstanceInfo
;
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
//******************************************************************************
45
class
CTX_EXPORT
ctxDebugInterface
:
public
gzReference
46
{
47
public
:
48
49
GZ_DECLARE_TYPE_INTERFACE
;
50
51
gzVoid
setDebugFlags
(
ctxDebugInstanceManager
*manager,
const
ctxDebugFlags
&flags);
52
ctxDebugFlags
getDebugFlags
(
ctxDebugInstanceManager
*manager);
53
54
gzVoid
setLayerID
(
ctxDebugInstanceManager
*manager,
const
gzUInt32 &layerID);
55
gzUInt32
getLayerID
(
ctxDebugInstanceManager
*manager);
56
57
gzVoid
setFeature
(
ctxDebugInstanceManager
*manager,
const
gzUInt32 &featureIndex,
const
gzUInt32XYZ& featurePosition);
58
gzUInt32
getFeatureIndex
(
ctxDebugInstanceManager
*manager);
59
gzUInt32XYZ
getFeaturePosition
(
ctxDebugInstanceManager
*manager);
60
};
61
62
GZ_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
//******************************************************************************
78
class
CTX_EXPORT
ctxDebuggerInterface
:
public
gzReference
79
{
80
public
:
81
82
GZ_DECLARE_TYPE_INTERFACE
;
83
84
virtual
gzVoid
onDebug
(
ctxDebugInterface
*instance,
ctxDebugInstanceInfo
*info,
ctxDebugInstanceManager
*manager) = 0;
85
};
86
87
GZ_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
//******************************************************************************
106
class
ctxDebugInstanceInfo
:
public
gzReference
107
{
108
public
:
109
110
ctxDebugInstanceInfo
()
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
//******************************************************************************
144
class
ctxDebugInstanceManager
145
{
146
public
:
147
148
CTX_EXPORT
ctxDebugInstanceManager
();
149
150
CTX_EXPORT
gzVoid
setDebugFlags
(
ctxDebugInterface
*instance,
const
ctxDebugFlags
&flags);
151
CTX_EXPORT
ctxDebugFlags
getDebugFlags
(
ctxDebugInterface
*instance);
152
153
CTX_EXPORT
gzVoid
setLayerID
(
ctxDebugInterface
*instance,
const
gzUInt32 &layerID);
154
CTX_EXPORT
gzUInt32
getLayerID
(
ctxDebugInterface
*instance);
155
156
157
CTX_EXPORT
gzVoid
setFeature
(
ctxDebugInterface
*instance,
const
gzUInt32 &featureIndex,
const
gzUInt32XYZ& featurePosition);
158
CTX_EXPORT
gzUInt32
getFeatureIndex
(
ctxDebugInterface
*instance);
159
CTX_EXPORT
gzUInt32XYZ
getFeaturePosition
(
ctxDebugInterface
*instance);
160
161
CTX_EXPORT
gzVoid
debug
();
162
164
CTX_EXPORT
gzBool
hasDebugInstances
()
const
;
165
CTX_EXPORT
gzBool
hasActiveDebugFlags
()
const
;
167
CTX_EXPORT
gzVoid
clearDebugInstances
();
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
176
private
:
177
178
gzRefDict<gzInstanceCompareInterface, ctxDebugInstanceInfo> m_instances;
179
gzRefDict<gzInstanceCompareInterface, ctxDebuggerInterface> m_debuggers;
180
};
181
182
#endif
// __CTX_DEBUG_H__
ctxDebugInstanceInfo
Definition
ctxDebug.h:107
ctxDebugInstanceInfo::ctxDebugInstanceInfo
ctxDebugInstanceInfo()
Definition
ctxDebug.h:110
ctxDebugInstanceManager
Definition
ctxDebug.h:145
ctxDebugInstanceManager::unregisterDebugger
gzVoid unregisterDebugger(gzType *type, ctxDebuggerInterface *debugger)
ctxDebugInstanceManager::hasActiveDebugFlags
gzBool hasActiveDebugFlags() const
ctxDebugInstanceManager::registerDebugger
gzVoid registerDebugger(gzType *type, ctxDebuggerInterface *debugger)
ctxDebugInstanceManager::clearDebugInstances
gzVoid clearDebugInstances()
Releases object-address metadata at an explicit realization boundary.
ctxDebugInstanceManager::ctxDebugInstanceManager
ctxDebugInstanceManager()
ctxDebugInstanceManager::debug
gzVoid debug(gzType *type, ctxDebugInterface *instance, ctxDebugInstanceInfo *info)
ctxDebugInstanceManager::getDebugFlags
ctxDebugFlags getDebugFlags(ctxDebugInterface *instance)
ctxDebugInstanceManager::getLayerID
gzUInt32 getLayerID(ctxDebugInterface *instance)
ctxDebugInstanceManager::getFeatureIndex
gzUInt32 getFeatureIndex(ctxDebugInterface *instance)
ctxDebugInstanceManager::setDebugFlags
gzVoid setDebugFlags(ctxDebugInterface *instance, const ctxDebugFlags &flags)
ctxDebugInstanceManager::hasDebugInstances
gzBool hasDebugInstances() const
Returns TRUE when any instance has registered debug flags, layer or feature state.
ctxDebugInstanceManager::getOptimizeRegisterKeepLists
gzVoid getOptimizeRegisterKeepLists(gzDynamicArray< gzUInt32 > &valueKeepList, gzDynamicArray< gzUInt32 > &deltaKeepList)
ctxDebugInstanceManager::setLayerID
gzVoid setLayerID(ctxDebugInterface *instance, const gzUInt32 &layerID)
ctxDebugInstanceManager::setFeature
gzVoid setFeature(ctxDebugInterface *instance, const gzUInt32 &featureIndex, const gzUInt32XYZ &featurePosition)
ctxDebugInstanceManager::getFeaturePosition
gzUInt32XYZ getFeaturePosition(ctxDebugInterface *instance)
ctxDebugInstanceManager::debug
gzVoid debug()
ctxDebugInterface
Definition
ctxDebug.h:46
ctxDebugInterface::GZ_DECLARE_TYPE_INTERFACE
GZ_DECLARE_TYPE_INTERFACE
Provides Run Time Type Info (RTTI) for the gzTypeInterface.
Definition
ctxDebug.h:49
ctxDebugInterface::setLayerID
gzVoid setLayerID(ctxDebugInstanceManager *manager, const gzUInt32 &layerID)
ctxDebugInterface::getFeatureIndex
gzUInt32 getFeatureIndex(ctxDebugInstanceManager *manager)
ctxDebugInterface::getFeaturePosition
gzUInt32XYZ getFeaturePosition(ctxDebugInstanceManager *manager)
ctxDebugInterface::setDebugFlags
gzVoid setDebugFlags(ctxDebugInstanceManager *manager, const ctxDebugFlags &flags)
ctxDebugInterface::setFeature
gzVoid setFeature(ctxDebugInstanceManager *manager, const gzUInt32 &featureIndex, const gzUInt32XYZ &featurePosition)
ctxDebugInterface::getDebugFlags
ctxDebugFlags getDebugFlags(ctxDebugInstanceManager *manager)
ctxDebugInterface::getLayerID
gzUInt32 getLayerID(ctxDebugInstanceManager *manager)
ctxDebuggerInterface
Definition
ctxDebug.h:79
ctxDebuggerInterface::onDebug
virtual gzVoid onDebug(ctxDebugInterface *instance, ctxDebugInstanceInfo *info, ctxDebugInstanceManager *manager)=0
ctxDebuggerInterface::GZ_DECLARE_TYPE_INTERFACE
GZ_DECLARE_TYPE_INTERFACE
Provides Run Time Type Info (RTTI) for the gzTypeInterface.
Definition
ctxDebug.h:82
ctxBase.h
CTX_EXPORT
#define CTX_EXPORT
Definition
ctxBase.h:68
ctxDebugFlags
ctxDebugFlags
Definition
ctxTypes.h:47
CTX_DEBUG_OFF
@ CTX_DEBUG_OFF
Definition
ctxTypes.h:48
CTX_UNDEFINED_INDEX
const gzUInt32 CTX_UNDEFINED_INDEX
Definition
ctxTypes.h:35
Generated by
1.18.0