2016-02-16 23:21:12 +03:00
|
|
|
#include "profile_manager.h"
|
|
|
|
#include "profiler/profiler.h"
|
|
|
|
|
|
|
|
using namespace profiler;
|
|
|
|
|
|
|
|
extern "C"{
|
|
|
|
|
2016-02-17 18:18:06 +03:00
|
|
|
void PROFILER_API registerMark(Mark* _mark)
|
|
|
|
{
|
|
|
|
ProfileManager::instance().registerMark(_mark);
|
|
|
|
}
|
2016-02-16 23:21:12 +03:00
|
|
|
|
2016-02-17 18:18:06 +03:00
|
|
|
void PROFILER_API endBlock()
|
|
|
|
{
|
|
|
|
ProfileManager::instance().endBlock();
|
|
|
|
}
|
2016-02-18 00:45:13 +03:00
|
|
|
|
2016-02-17 18:18:06 +03:00
|
|
|
void PROFILER_API setEnabled(bool isEnable)
|
|
|
|
{
|
|
|
|
ProfileManager::instance().setEnabled(isEnable);
|
|
|
|
}
|
2016-02-18 00:45:13 +03:00
|
|
|
void PROFILER_API beginBlock(Block* _block)
|
|
|
|
{
|
2016-02-17 18:18:06 +03:00
|
|
|
ProfileManager::instance().beginBlock(_block);
|
2016-02-18 00:45:13 +03:00
|
|
|
}
|
2016-02-16 23:21:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ProfileManager::ProfileManager()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-17 18:18:06 +03:00
|
|
|
ProfileManager& ProfileManager::instance()
|
2016-02-16 23:21:12 +03:00
|
|
|
{
|
2016-02-17 18:18:06 +03:00
|
|
|
///C++11 makes possible to create Singleton without any warry about thread-safeness
|
|
|
|
///http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/
|
|
|
|
static ProfileManager m_profileManager;
|
|
|
|
return m_profileManager;
|
2016-02-16 23:21:12 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void ProfileManager::registerMark(profiler::Mark* _mark)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-18 00:45:13 +03:00
|
|
|
void ProfileManager::beginBlock(profiler::Block* _block)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-02-16 23:21:12 +03:00
|
|
|
void ProfileManager::endBlock()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void ProfileManager::setEnabled(bool isEnable)
|
|
|
|
{
|
|
|
|
m_isEnabled = isEnable;
|
2016-02-16 23:25:12 +03:00
|
|
|
}
|