38#ifndef Foam_profilingTrigger_H
39#define Foam_profilingTrigger_H
66 static bool possible()
noexcept;
69 static inline void string_concat(std::string& output) {}
72 template<
class StringType,
class... StringArgs>
73 static inline void string_concat
76 const StringType& str,
81 string_concat(output, std::forward<StringArgs>(
args)...);
85 void enter(
const std::string&
name);
88 template<
class... StringArgs>
89 void trigger(std::string
name, StringArgs&&...
args)
91 string_concat(
name, std::forward<StringArgs>(
args)...);
119 template<
class... StringArgs>
127 trigger(std::forward<StringArgs>(description)...);
157#define addProfiling(Name, ...) \
158 ::Foam::profilingTrigger profilingTriggerFor##Name(__VA_ARGS__)
162#define endProfiling(Name) profilingTriggerFor##Name.stop()
168#define addProfilingInFunction(Name) \
169 ::Foam::profilingTrigger profilingTriggerFor##Name(__PRETTY_FUNCTION__)
171#define addProfilingInFunction(Name) \
172 ::Foam::profilingTrigger profilingTriggerFor##Name(__func__)
profilingTrigger(StringArgs &&... description)
Start profiling section (if profiling is active) with given description.
constexpr profilingTrigger() noexcept
Default construct, no profiling trigger.
profilingTrigger(const profilingTrigger &)=delete
No copy construct.
void stop()
Stop triggered profiling section.
~profilingTrigger()
Destructor, calls stop().
bool running() const noexcept
True if the triggered profiling section is active.
void operator=(const profilingTrigger &)=delete
No copy assignment.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Foam::argList args(argc, argv)