0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-29 10:05:48 +08:00
easy_profiler/src/profile_manager.cpp

61 lines
1.1 KiB
C++
Raw Normal View History

2016-02-16 23:21:12 +03:00
#include "profile_manager.h"
#include "profiler/profiler.h"
using namespace profiler;
extern "C"{
void PROFILER_API registerMark(Mark* _mark)
{
ProfileManager::instance().registerMark(_mark);
}
2016-02-16 23:21:12 +03:00
void PROFILER_API endBlock()
{
ProfileManager::instance().endBlock();
}
2016-02-18 00:45:13 +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)
{
ProfileManager::instance().beginBlock(_block);
2016-02-18 00:45:13 +03:00
}
2016-02-16 23:21:12 +03:00
}
ProfileManager::ProfileManager()
{
}
ProfileManager& ProfileManager::instance()
2016-02-16 23:21:12 +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
}