Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tdebugmessage.h"
Toshihiro Shimizu 890ddd
#include <iostream></iostream>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
using namespace std;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
namespace
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TDebugMessage::Manager *debugManagerInstance = 0;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
void TDebugMessage::setManager(Manager *manager)
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	debugManagerInstance = manager;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
ostream &TDebugMessage::getStream()
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	if (debugManagerInstance)
Toshihiro Shimizu 890ddd
		return debugManagerInstance->getStream();
Toshihiro Shimizu 890ddd
	else
Toshihiro Shimizu 890ddd
		return cout;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
void TDebugMessage::flush(int code)
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	if (debugManagerInstance)
Toshihiro Shimizu 890ddd
		debugManagerInstance->flush(code);
Toshihiro Shimizu 890ddd
	else
Toshihiro Shimizu 890ddd
		cout << endl;
Toshihiro Shimizu 890ddd
}