Skip to content

Instantly share code, notes, and snippets.

@mihaisebea
Last active February 27, 2018 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mihaisebea/ae0c9dcc1dfb8b4c8b0873feef53d732 to your computer and use it in GitHub Desktop.
Save mihaisebea/ae0c9dcc1dfb8b4c8b0873feef53d732 to your computer and use it in GitHub Desktop.
class Profiler
{
Profiler::Profiler()
public :
void Update()
{
//m_debugger.Update();
sig_Update.emit()
sig_Log.emit("Profiler updating")
}
Signal<void> sig_Update;
Signal<void(std::string)> sig_Log;
};
class Debugger
{
public:
Debugger::Debugger()
void Update()
{
sigLog.emit("Debugger updating")
}
Signal<void(std::string)> sig_Log;
};
class Logger
{
public:
void Log(...)
{
printf();
}
};
class Game()
{
public:
Game::Game()
: m_logger()
, m_debugger()
, m_profiler()
{
m_debuggerLoggerConnection = m_debugger.sig_Log.connect(&Logger::Log, m_logger);
m_profilerLoggerConnection = m_profiler.sig_Log.connect(&Logger::Log, m_profiler);
m_profilerDebuggerConnection = m_profiler.sig_Update.connect(&Debugger::Update, m_debugger)
}
void Update()
{
m_profiler.Update();
}
private:
Logger m_logger;
Connection m_debuggerLoggerConnection;
Debugger m_debugger;
Connection m_profilerLoggerConnection;
Profiler m_profiler;
Connection m_profilerDebuggerConnection;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment