#ifndef __AMASS_LEAKTRACER_H__ #define __AMASS_LEAKTRACER_H__ #include #include #include class LeakTracer { public: LeakTracer(const std::string &path, const std::string &applicationName); ~LeakTracer(); template void start(const std::chrono::duration &intervals) { if (m_exit) { m_exit = false; m_thread = std::thread(&LeakTracer::run, this); } m_intervals = std::chrono::duration_cast(intervals); } void stop(); protected: void run(); private: bool m_exit = true; std::string m_path; std::string m_applicationName; std::chrono::milliseconds m_intervals; std::thread m_thread; }; #endif // __AMASS_LEAKTRACER_H__