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
Shinya Kitaoka 120a6e
namespace {
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TDebugMessage::Manager *debugManagerInstance = 0;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TDebugMessage::setManager(Manager *manager) {
Shinya Kitaoka 120a6e
  debugManagerInstance = manager;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
ostream &TDebugMessage::getStream() {
Shinya Kitaoka 120a6e
  if (debugManagerInstance)
Shinya Kitaoka 120a6e
    return debugManagerInstance->getStream();
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    return cout;
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
void TDebugMessage::flush(int code) {
Shinya Kitaoka 120a6e
  if (debugManagerInstance)
Shinya Kitaoka 120a6e
    debugManagerInstance->flush(code);
Shinya Kitaoka 120a6e
  else
Shinya Kitaoka 120a6e
    cout << endl;
Toshihiro Shimizu 890ddd
}