Open Reality Reference Guide
|
|
1 #ifndef __FBPROFILER_H__
2 #define __FBPROFILER_H__
39 #include <kaydaradef.h>
44 #define FBSDK_DLL K_DLLIMPORT
50 #ifdef FBSDKUseNamespace
51 namespace FBSDKNamespace {
60 #define FBProfiler_CreateTaskCycle( pClass, pR, pG, pB ) \
61 int gProfilingIndex_##pClass = -1; \
62 float gProfilingColor_##pClass[3] = { pR, pG, pB };
69 #define FBProfiling_SetupTaskCycle( pClass ) \
70 if(gProfilingIndex_##pClass == -1) \
71 gProfilingIndex_##pClass = FBProfiler::TheOne().RegisterTaskCycle(#pClass,gProfilingColor_##pClass);
78 #define FBProfiling_TaskCycleIndex( pClass ) \
79 gProfilingIndex_##pClass
209 kFBProfilingModeDisabled = 0,
210 kFBProfilingModeEvaluation,
211 kFBProfilingModeRendering,
212 kFBProfilingModeDevices,
214 kFBProfilingModeAllLow,
215 kFBProfilingModeAllHi
345 inline bool IsStarted() {
return mCurrentTaskCycle != NULL; }
362 #ifdef FBSDKUseNamespace
static int RegisterTaskCycle(const char *pUniqueName, float *pColor=NULL)
Register a new task cycle for profiling.
FBPropertyBool ActiveSampling
Read/Write Property: Activate the sampling for time events. Call before quering for FBProfileTimeEven...
#define FB_DEFINE_ENUM(DllTag, Type)
Define an enum and give it the ability to be a property.
~FBProfilerHelper()
Destructor.
FBProfileTimeEvent * GetEndEventSample(int pIndex)
Get end time event for event at given index.
class K_DLLIMPORT FBPropertyBase< int, kFBPT_int > FBPropertyInt
Property: int
void Stop()
Stop sample. Can be done manually, before destruction of the object.
double GetStatDuration(int pIndex)
Get time that was spend on execution of action.
bool IsSingleEvent()
Three types of events exits: single, start and end. Some actions that takes more time to execute or w...
#define FBSDK_DLL
Be sure that FBSDK_DLL is defined only once...
FBPropertyProfilingMode ProfilingMode
Read/Write Property: Profiling collection modes, including disabling all profiling.
FBProfilerHelper(int pTC_RegisterationIndex, FBEvaluateInfo *pEvaluateInfo, FBProfileTaskCycle *pParentTaskCycle=NULL)
Constructor.
FBProfiler(HIObject pObject=NULL)
Constructor.
const float * GetColor()
Get the color of the task cycle. Used in profiling Center for drawing.
FBPropertyBool FrameReference
Read/Write Property: Draw task cycles in relation to main thread cycle time - frame cycle (percentage...
void Start()
Start of task cycle sample. In most cases should be controlled by FBProfilerHelper.
const char * GetStatComment(int pIndex)
Get aditional information about what action is stat refering to.
static FBProfiler & TheOne()
Get the global object for this class.
int GetChildCount()
Get number of child tasks.
bool IsStarted()
Test to see if profiling is started. Useful to verify if profiling is in progress.
int GetThreadID()
Get the thread ID used in the event execution.
int GetStatIndex(const char *pName)
Search for index of given stat name.
const char * GetTypeName()
Get the event registered type name.
#define __FBClassDeclare(Name, Parent)
For internal use only.
#define __FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
FBPropertyInt BufferSize
Read/Write Property: Buffer size for average and timing computation (maximum value 200).
void Stop()
Stop of task cycle sample. In most cases should be controlled by FBProfilerHelper.
const char * GetComment()
Get the comment for the event. Comments are not editable.
void GetAvgMinMaxUsage(double &pAvg, double &pMin, double &pMax)
Get the task cycle's average, minimum and maximum usage.
const char * GetName()
Get the name of task cycle.
FBTime GetTime()
Get the time when the event occurred.
FBProfileTaskCycle * GetChild(int pIndex)
Get child task based on specific index.
class K_DLLIMPORT FBPropertyBase< bool, kFBPT_bool > FBPropertyBool
Property: bool
FBProfileTimeEvent * GetEventSample(int pIndex)
Only possible way to query collected FBProfileTimeEvent.
bool IsStarted()
Test to see if sampling has started.
Contains definitions for devices, boxes and models.
static bool IsTaskCycleNameRegistered(const char *pName)
Test to see if a task cycle is already registered based on the name provided.
double GetStatStart(int pIndex)
Get start time of action.
#define FB_FORWARD(ClassName)
Forwarding of class and typedef declaration.
int GetIndex()
Get the unique registration index for each cycle.
const char * GetStatName(int pIndex)
Get information about what action is stat refering to.
int GetEventSampleCount()
Get number of time event samples collected during last sampling.
AnimationNodeNotify evaluation information.
MotionBuilder SDK base class.
double GetStatStop(int pIndex)
Get stop time of action.
int GetStatCount()
Stats are holding last execution time/duration of action.
FBPropertyInt EvaluationDepth
Read/Write Property: Specify the depth of evaluation profiling for data collection (maximum value is ...
const float * GetColor()
Get the color assigned to the event.
double GetProfilingCost()
Profiling collection can affect scene performace.