2017-09-10 15:43:56 +00:00
|
|
|
#ifndef __TRACYPROFILER_HPP__
|
|
|
|
#define __TRACYPROFILER_HPP__
|
|
|
|
|
|
|
|
#include <atomic>
|
2017-09-10 18:08:42 +00:00
|
|
|
#include <stdint.h>
|
2017-09-10 15:43:56 +00:00
|
|
|
#include <thread>
|
|
|
|
|
2017-09-10 18:09:14 +00:00
|
|
|
#include "concurrentqueue.h"
|
|
|
|
#include "TracyQueue.hpp"
|
|
|
|
|
2017-09-10 15:43:56 +00:00
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class Profiler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Profiler();
|
|
|
|
~Profiler();
|
|
|
|
|
2017-09-10 18:08:42 +00:00
|
|
|
static uint64_t GetNewId();
|
|
|
|
|
2017-09-10 18:09:14 +00:00
|
|
|
static void ZoneBegin( QueueZoneBegin&& data );
|
|
|
|
static void ZoneEnd( QueueZoneEnd&& data );
|
|
|
|
|
2017-09-10 15:43:56 +00:00
|
|
|
private:
|
|
|
|
void Worker();
|
|
|
|
|
|
|
|
std::thread m_thread;
|
|
|
|
std::atomic<bool> m_shutdown;
|
2017-09-10 18:09:14 +00:00
|
|
|
moodycamel::ConcurrentQueue<QueueItem> m_queue;
|
2017-09-10 18:08:42 +00:00
|
|
|
std::atomic<uint64_t> m_id;
|
2017-09-10 15:43:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|