resources folder

This commit is contained in:
Janik Schlemminger
2014-03-27 16:32:13 +01:00
parent 542b56c48e
commit 62590e97e2
12 changed files with 3293 additions and 33 deletions

View File

@@ -7,6 +7,7 @@
#include "DebugManager.h"
#include <string>
#include <algorithm>
using namespace std;
@@ -18,30 +19,43 @@ DebugManager& DebugManager::getInstance()
void DebugManager::printDebug(string message, Sender sender, Importance importance)
{
cout << "[" << importanceToString(importance) << "]";
if(printTime) std::cout << " at " << sc_time_stamp();
if(printLocation) std::cout << " in " << senderToString(sender);
cout << ": " << message << endl;
bool show = count(whiteList.begin(), whiteList.end(),
pair<Sender, Importance>(sender, importance));
if (show)
{
cout << "[" << importanceToString(importance) << "]";
if (printTime)
std::cout << " at " << sc_time_stamp();
if (printLocation)
std::cout << " in " << senderToString(sender);
cout << ": " << message << endl;
}
}
string DebugManager::importanceToString(Importance importancy)
{
switch(importancy)
switch (importancy)
{
case Importance::Info: return "[Info]";
case Importance::Warning: return "[Warning]";
case Importance::Error: return "[Error]";
case Importance::Info:
return "Info";
case Importance::Warning:
return "Warning";
case Importance::Error:
return "Error";
}
return "unknown importance";
}
string DebugManager::senderToString(Sender sender)
{
switch(sender)
switch (sender)
{
case Sender::Core: return "Core";
case Sender::Scheduler: return "Scheduler";
case Sender::TracePlayer: return "TracePlayer";
case Sender::Core:
return "Core";
case Sender::Scheduler:
return "Scheduler";
case Sender::TracePlayer:
return "TracePlayer";
}
return "unknown sender";
}