38 #ifndef Foam_profilingTrigger_H 39 #define Foam_profilingTrigger_H 49 class profilingInformation;
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__) bool running() const noexcept
True if the triggered profiling section is active.
~profilingTrigger()
Destructor, calls stop()
Triggers for starting/stopping code profiling.
constexpr profilingTrigger() noexcept
Default construct, no profiling trigger.
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.
void stop()
Stop triggered profiling section.
static Ostream & output(Ostream &os, const IntRange< T > &range)
Foam::argList args(argc, argv)