profilingInformation Class Reference

Code profiling information in terms of time spent, number of calls etc. More...

Public Member Functions

 profilingInformation (profilingInformation *parent, const std::string &descr, const label id)
 Construct from components. More...
 
 ~profilingInformation ()=default
 Destructor. More...
 
label id () const noexcept
 
const std::string & description () const noexcept
 
profilingInformationparent () const noexcept
 
label calls () const noexcept
 
scalar totalTime () const noexcept
 
scalar childTime () const noexcept
 
int maxMem () const noexcept
 
bool active () const noexcept
 
void update (const scalar elapsedTime)
 Update it with a new timing information. More...
 
Ostreamwrite (Ostream &os, const bool offset=false, const scalar elapsedTime=0, const scalar childTime=0) const
 Write the profiling times, optionally with additional values. More...
 

Protected Member Functions

 profilingInformation ()
 Default construct - only the master-element. More...
 
 profilingInformation (const profilingInformation &)=delete
 No copy construct. More...
 
void operator= (const profilingInformation &)=delete
 No copy assignment. More...
 
void setActive (bool state) const
 Mark as being active or passive. More...
 

Friends

class profiling
 Allow creation of master-element, setActive etc. More...
 

Detailed Description

Code profiling information in terms of time spent, number of calls etc.

Source files

Definition at line 52 of file profilingInformation.H.

Constructor & Destructor Documentation

◆ profilingInformation() [1/3]

profilingInformation ( )
protected

Default construct - only the master-element.

Definition at line 28 of file profilingInformation.C.

◆ profilingInformation() [2/3]

profilingInformation ( const profilingInformation )
protecteddelete

No copy construct.

◆ profilingInformation() [3/3]

profilingInformation ( profilingInformation parent,
const std::string &  descr,
const label  id 
)

Construct from components.

Definition at line 42 of file profilingInformation.C.

◆ ~profilingInformation()

~profilingInformation ( )
default

Destructor.

Member Function Documentation

◆ operator=()

void operator= ( const profilingInformation )
protecteddelete

No copy assignment.

◆ setActive()

void setActive ( bool  state) const
protected

Mark as being active or passive.

Definition at line 75 of file profilingInformation.C.

Referenced by profiling::beginTimer(), and profiling::endTimer().

Here is the caller graph for this function:

◆ id()

label id ( ) const
inlinenoexcept

Definition at line 159 of file profilingInformation.H.

Referenced by profiling::create(), and profiling::unstack().

Here is the caller graph for this function:

◆ description()

const std::string& description ( ) const
inlinenoexcept

Definition at line 161 of file profilingInformation.H.

Referenced by profiling::unstack().

Here is the caller graph for this function:

◆ parent()

profilingInformation& parent ( ) const
inlinenoexcept

Definition at line 163 of file profilingInformation.H.

◆ calls()

label calls ( ) const
inlinenoexcept

Definition at line 165 of file profilingInformation.H.

◆ totalTime()

scalar totalTime ( ) const
inlinenoexcept

Definition at line 167 of file profilingInformation.H.

◆ childTime()

scalar childTime ( ) const
inlinenoexcept

Definition at line 169 of file profilingInformation.H.

◆ maxMem()

int maxMem ( ) const
inlinenoexcept

Definition at line 171 of file profilingInformation.H.

◆ active()

bool active ( ) const
inlinenoexcept

Definition at line 173 of file profilingInformation.H.

◆ update()

void update ( const scalar  elapsedTime)

Update it with a new timing information.

Definition at line 61 of file profilingInformation.C.

Referenced by profiling::endTimer(), and profiling::New().

Here is the caller graph for this function:

◆ write()

Foam::Ostream & write ( Ostream os,
const bool  offset = false,
const scalar  elapsedTime = 0,
const scalar  childTime = 0 
) const

Write the profiling times, optionally with additional values.

Uses dictionary format.

Definition at line 82 of file profilingInformation.C.

References Ostream::beginBlock(), Ostream::endBlock(), Foam::name(), Switch::name(), os(), Ostream::writeEntry(), and Ostream::writeEntryIfDifferent().

Referenced by Foam::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ profiling

friend class profiling
friend

Allow creation of master-element, setActive etc.

Definition at line 106 of file profilingInformation.H.


The documentation for this class was generated from the following files: