SOFA API  1c8b807d
Open source framework for multi-physics simuation
sofa::helper::AdvancedTimer Class Reference

#include <AdvancedTimer.h>

Classes

class  Id
 
class  Obj
 
class  Step
 
class  StepVar
 
class  Timer
 
class  TimerVar
 
class  Val
 

Static Public Member Functions

static bool isEnabled (IdTimer id)
 
static void setEnabled (IdTimer id, bool val)
 
static int getInterval (IdTimer id)
 
static void setInterval (IdTimer id, int val)
 
static AdvancedTimer::outputType convertOutputType (std::string type)
 convertOutputType convert a string to the output type More...
 
static void setOutputType (IdTimer id, const std::string &type)
 setOutputType Set the outputType for the given AdvancedTimer. More...
 
static AdvancedTimer::outputType getOutputType (IdTimer id)
 getOutputType Get the outputType for the given AdvancedTimer. More...
 
static std::string getTimeAnalysis (IdTimer id, double time, double dt)
 getTimeAnalysis Return the result of the AdvancedTimer More...
 
static type::vector< AdvancedTimer::IdStepgetSteps (IdTimer id, bool processData=false)
 getSteps Return the vector of IDStep of the AdvancedTimer given execution More...
 
static std::map< AdvancedTimer::IdStep, StepDatagetStepData (IdTimer id, bool processData=false)
 getStepData Return the map of StepData of the AdvancedTimer given execution More...
 
static type::vector< RecordgetRecords (IdTimer id)
 getRecords the vector of Record of the AdvancedTimer given execution id. More...
 
static void clearData (IdTimer id)
 clearDatato clear a specific Timer Data More...
 
static void clear ()
 
static void begin (IdTimer id)
 
static void end (IdTimer id)
 
static void end (IdTimer id, std::ostream &result)
 
static std::string end (IdTimer id, double time, double dt)
 end Override fo the end method in which you can use JSON or old format More...
 
static bool isActive ()
 
static void stepBegin (IdStep id)
 
static void stepBegin (IdStep id, IdObj obj)
 
template<class T >
static void stepBegin (IdStep id, T *obj)
 
static void stepEnd (IdStep id)
 
static void stepEnd (IdStep id, IdObj obj)
 
template<class T >
static void stepEnd (IdStep id, T *obj)
 
static void stepNext (IdStep prevId, IdStep nextId)
 
static void step (IdStep id)
 
static void step (IdStep id, IdObj obj)
 
template<class T >
static void step (IdStep id, T *obj)
 
static void begin (const char *idStr)
 
static void end (const char *idStr)
 
static void stepBegin (const char *idStr)
 
static void stepBegin (const char *idStr, const char *objStr)
 
static void stepBegin (const char *idStr, const std::string &objStr)
 
template<class T >
static void stepBegin (const char *idStr, T *obj)
 
static void stepEnd (const char *idStr)
 
static void stepEnd (const char *idStr, const char *objStr)
 
static void stepEnd (const char *idStr, const std::string &objStr)
 
template<class T >
static void stepEnd (const char *idStr, T *obj)
 
static void stepNext (const char *prevIdStr, const char *nextIdStr)
 
static void step (const char *idStr)
 
static void step (const char *idStr, const char *objStr)
 
static void step (const char *idStr, const std::string &objStr)
 
template<class T >
static void step (const char *idStr, T *obj)
 
static void valSet (IdVal id, double val)
 
static void valAdd (IdVal id, double val)
 
static void valSet (const char *idStr, double val)
 
static void valAdd (const char *idStr, double val)
 
static std::pair< SyncCallBack, void * > setSyncCallBack (SyncCallBack cb, void *userData=nullptr)
 

Function details

◆ begin() [1/2]

void sofa::helper::AdvancedTimer::begin ( const char idStr)
static

◆ begin() [2/2]

void sofa::helper::AdvancedTimer::begin ( IdTimer  id)
static

◆ clear()

void sofa::helper::AdvancedTimer::clear ( )
static

◆ clearData()

void sofa::helper::AdvancedTimer::clearData ( IdTimer  id)
static

clearDatato clear a specific Timer Data

Parameters
idIdTimer, id of the timer

◆ convertOutputType()

AdvancedTimer::outputType sofa::helper::AdvancedTimer::convertOutputType ( std::string  type)
static

convertOutputType convert a string to the output type

Parameters
typestd::string, output type name (example : "json")
Returns
outputType, output type enum

◆ end() [1/4]

void sofa::helper::AdvancedTimer::end ( const char idStr)
static

◆ end() [2/4]

void sofa::helper::AdvancedTimer::end ( IdTimer  id)
static

◆ end() [3/4]

std::string sofa::helper::AdvancedTimer::end ( IdTimer  id,
double  time,
double  dt 
)
static

end Override fo the end method in which you can use JSON or old format

Parameters
idIdTimer, the id of the used timer
timedouble, current time (from the context)
timedt, current delta time or dt (from the context)
Returns
std::string, the output if JSON format is set

◆ end() [4/4]

void sofa::helper::AdvancedTimer::end ( IdTimer  id,
std::ostream &  result 
)
static

◆ getInterval()

int sofa::helper::AdvancedTimer::getInterval ( IdTimer  id)
static

◆ getOutputType()

AdvancedTimer::outputType sofa::helper::AdvancedTimer::getOutputType ( IdTimer  id)
static

getOutputType Get the outputType for the given AdvancedTimer.

Parameters
ididTimer, id of the timer
Returns
the output type

◆ getRecords()

type::vector< Record > sofa::helper::AdvancedTimer::getRecords ( IdTimer  id)
static

getRecords the vector of Record of the AdvancedTimer given execution id.

Parameters
idIdTimer, id of the timer
Returns
The timer full records inside a vector of Record

◆ getStepData()

std::map< AdvancedTimer::IdStep, StepData > sofa::helper::AdvancedTimer::getStepData ( IdTimer  id,
bool  processData = false 
)
static

getStepData Return the map of StepData of the AdvancedTimer given execution

Parameters
idIdTimer, id of the timer
processDatabool, if true, will force timer data to be processed
Returns
The timer StepData of each timer step inside a map

◆ getSteps()

type::vector< AdvancedTimer::IdStep > sofa::helper::AdvancedTimer::getSteps ( IdTimer  id,
bool  processData = false 
)
static

getSteps Return the vector of IDStep of the AdvancedTimer given execution

Parameters
idIdTimer, id of the timer
processDatabool, if true, will force timer data to be processed
Returns
The timer steps iterator inside a vector

◆ getTimeAnalysis()

std::string sofa::helper::AdvancedTimer::getTimeAnalysis ( IdTimer  id,
double  time,
double  dt 
)
static

getTimeAnalysis Return the result of the AdvancedTimer

Parameters
idIdTimer, id of the timer
timedouble, current time (from the context)
timedt, current delta time or dt (from the context)
Returns
The timer value in JSON

◆ isActive()

bool sofa::helper::AdvancedTimer::isActive ( )
static

◆ isEnabled()

bool sofa::helper::AdvancedTimer::isEnabled ( IdTimer  id)
static

◆ setEnabled()

void sofa::helper::AdvancedTimer::setEnabled ( IdTimer  id,
bool  val 
)
static

◆ setInterval()

void sofa::helper::AdvancedTimer::setInterval ( IdTimer  id,
int  val 
)
static

◆ setOutputType()

void sofa::helper::AdvancedTimer::setOutputType ( IdTimer  id,
const std::string &  type 
)
static

setOutputType Set the outputType for the given AdvancedTimer.

Parameters
idIdTimer, id of the timer
typestd::string, output type name (example : "json")

◆ setSyncCallBack()

std::pair< AdvancedTimer::SyncCallBack, void * > sofa::helper::AdvancedTimer::setSyncCallBack ( SyncCallBack  cb,
void *  userData = nullptr 
)
static

◆ step() [1/7]

void sofa::helper::AdvancedTimer::step ( const char idStr)
static

◆ step() [2/7]

void sofa::helper::AdvancedTimer::step ( const char idStr,
const char objStr 
)
static

◆ step() [3/7]

void sofa::helper::AdvancedTimer::step ( const char idStr,
const std::string &  objStr 
)
static

◆ step() [4/7]

template<class T >
static void sofa::helper::AdvancedTimer::step ( const char idStr,
T *  obj 
)
inlinestatic

◆ step() [5/7]

void sofa::helper::AdvancedTimer::step ( IdStep  id)
static

◆ step() [6/7]

void sofa::helper::AdvancedTimer::step ( IdStep  id,
IdObj  obj 
)
static

◆ step() [7/7]

template<class T >
static void sofa::helper::AdvancedTimer::step ( IdStep  id,
T *  obj 
)
inlinestatic

◆ stepBegin() [1/7]

void sofa::helper::AdvancedTimer::stepBegin ( const char idStr)
static

◆ stepBegin() [2/7]

void sofa::helper::AdvancedTimer::stepBegin ( const char idStr,
const char objStr 
)
static

◆ stepBegin() [3/7]

void sofa::helper::AdvancedTimer::stepBegin ( const char idStr,
const std::string &  objStr 
)
static

◆ stepBegin() [4/7]

template<class T >
static void sofa::helper::AdvancedTimer::stepBegin ( const char idStr,
T *  obj 
)
inlinestatic

◆ stepBegin() [5/7]

void sofa::helper::AdvancedTimer::stepBegin ( IdStep  id)
static

◆ stepBegin() [6/7]

void sofa::helper::AdvancedTimer::stepBegin ( IdStep  id,
IdObj  obj 
)
static

◆ stepBegin() [7/7]

template<class T >
static void sofa::helper::AdvancedTimer::stepBegin ( IdStep  id,
T *  obj 
)
inlinestatic

◆ stepEnd() [1/7]

void sofa::helper::AdvancedTimer::stepEnd ( const char idStr)
static

◆ stepEnd() [2/7]

void sofa::helper::AdvancedTimer::stepEnd ( const char idStr,
const char objStr 
)
static

◆ stepEnd() [3/7]

void sofa::helper::AdvancedTimer::stepEnd ( const char idStr,
const std::string &  objStr 
)
static

◆ stepEnd() [4/7]

template<class T >
static void sofa::helper::AdvancedTimer::stepEnd ( const char idStr,
T *  obj 
)
inlinestatic

◆ stepEnd() [5/7]

void sofa::helper::AdvancedTimer::stepEnd ( IdStep  id)
static

◆ stepEnd() [6/7]

void sofa::helper::AdvancedTimer::stepEnd ( IdStep  id,
IdObj  obj 
)
static

◆ stepEnd() [7/7]

template<class T >
static void sofa::helper::AdvancedTimer::stepEnd ( IdStep  id,
T *  obj 
)
inlinestatic

◆ stepNext() [1/2]

void sofa::helper::AdvancedTimer::stepNext ( const char prevIdStr,
const char nextIdStr 
)
static

◆ stepNext() [2/2]

void sofa::helper::AdvancedTimer::stepNext ( IdStep  prevId,
IdStep  nextId 
)
static

◆ valAdd() [1/2]

void sofa::helper::AdvancedTimer::valAdd ( const char idStr,
double  val 
)
static

◆ valAdd() [2/2]

void sofa::helper::AdvancedTimer::valAdd ( IdVal  id,
double  val 
)
static

◆ valSet() [1/2]

void sofa::helper::AdvancedTimer::valSet ( const char idStr,
double  val 
)
static

◆ valSet() [2/2]

void sofa::helper::AdvancedTimer::valSet ( IdVal  id,
double  val 
)
static

Enum details

◆ outputType

Enumerator
STDOUT 
LJSON 
JSON 
GUI