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