]> git.tdb.fi Git - libs/core.git/blobdiff - source/debug/profilingscope.h
Use vectors for storage in Poller
[libs/core.git] / source / debug / profilingscope.h
index adec3d452ec4db8dc5ff9d553ec4506d1a562ccb..4e4294e0269d04346c04e1c364d75f870fb231ee 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef MSP_DEBUG_PROFILINGSCOPE_H_
 #define MSP_DEBUG_PROFILINGSCOPE_H_
 
-#include "../time/timestamp.h"
+#include <msp/core/noncopyable.h>
+#include <msp/time/timestamp.h>
 #include "profiler.h"
 
 namespace Msp {
@@ -12,20 +13,27 @@ RAII timing class to accompany Profiler.  Timing starts when an object is
 created and ends when it goes out of scope.  If there was another object in an
 outer scope, it is notified of the time used in inner scopes.
 */
-class ProfilingScope
+class ProfilingScope: private NonCopyable
 {
 private:
        Profiler &profiler;
        std::string name;
        ProfilingScope *parent;
-       Time::TimeStamp start_t;
-       Time::TimeDelta child_t;
+       Time::TimeStamp entry_time;
+       Time::TimeDelta time_spent;
+       Time::TimeDelta child_time;
 
        ProfilingScope(const ProfilingScope &);
        ProfilingScope &operator=(const ProfilingScope &);
 public:
        ProfilingScope(Profiler &p, const std::string &n);
        ~ProfilingScope();
+
+       const std::string &get_name() const { return name; }
+       const ProfilingScope *get_parent() const { return parent; }
+       const Time::TimeStamp &get_entry_time() const { return entry_time; }
+       const Time::TimeDelta &get_time_spent() const { return time_spent; }
+       const Time::TimeDelta &get_child_time() const { return child_time; }
 };
 
 } // namespace Debug