Mercurial > hg > orthanc
changeset 6111:4e7f565e2604
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 16 May 2025 17:15:54 +0200 |
parents | 51810284444b |
children | 91dde382f780 61e298df01be |
files | OrthancFramework/Sources/Toolbox.h |
diffstat | 1 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancFramework/Sources/Toolbox.h Wed May 14 10:57:35 2025 +0200 +++ b/OrthancFramework/Sources/Toolbox.h Fri May 16 17:15:54 2025 +0200 @@ -82,7 +82,7 @@ class ORTHANC_PUBLIC Toolbox { public: - class ORTHANC_PUBLIC LinesIterator + class ORTHANC_PUBLIC LinesIterator : public boost::noncopyable { private: const std::string& content_; @@ -377,11 +377,13 @@ static void RemoveSurroundingQuotes(std::string& value); - class ORTHANC_PUBLIC ElapsedTimer + class ORTHANC_PUBLIC ElapsedTimer : public boost::noncopyable { + private: boost::posix_time::ptime start_; + public: - explicit ElapsedTimer(); + ElapsedTimer(); uint64_t GetElapsedMilliseconds(); uint64_t GetElapsedMicroseconds(); @@ -396,14 +398,16 @@ // This is a helper class to measure and log time spend e.g in a method. // This should be used only during debugging and should likely not ever be used in a release. // By default, you should use it as a RAII but you may force Restart/StopAndLog manually if needed. - class ORTHANC_PUBLIC DebugElapsedTimeLogger + class ORTHANC_PUBLIC DebugElapsedTimeLogger : public boost::noncopyable { + private: ElapsedTimer timer_; const std::string message_; - bool logged_; + bool logged_; public: explicit DebugElapsedTimeLogger(const std::string& message); + ~DebugElapsedTimeLogger(); void Restart(); @@ -412,12 +416,15 @@ // This variant logs the same message when entering the method and when exiting (with the elapsed time). // Logs goes to verbose-http. - class ORTHANC_PUBLIC ApiElapsedTimeLogger + class ORTHANC_PUBLIC ApiElapsedTimeLogger : public boost::noncopyable { + private: ElapsedTimer timer_; const std::string message_; + public: explicit ApiElapsedTimeLogger(const std::string& message); + ~ApiElapsedTimeLogger(); };