# HG changeset patch # User Sebastien Jodogne # Date 1747408554 -7200 # Node ID 4e7f565e26047417d2063d44119f80611433ee66 # Parent 51810284444bca0939916958e78804000a1ed1a0 cppcheck diff -r 51810284444b -r 4e7f565e2604 OrthancFramework/Sources/Toolbox.h --- 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(); };