Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
blob: b661afc002399a7c9f68e94abf1b0c0dee985131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
   common/console.h
   This file is part of the Osirion project and is distributed under 
   the terms of the GNU General Public License version 2 
*/

#ifndef __INCLUDED_CONSOLE_H__
#define __INCLUDED_CONSOLE_H__

// C++ headers
#include <iostream>

/// global define to send a message to the system console
#define conmesg common::Console::instance->message()
/// global define to send a warning message to the system console
#define conwarn common::Console::instance->warning()

#define DEBUG 1

#ifdef DEBUG
/// global define to send a debug message to the system console
#define condebug common::Console::instance->debug()
#else
#define condebug if (0) *(std::ostream*)(0)
#endif // DEBUG

namespace common {

/// Interface for a console object that writes messages on the screen
class Console {
public:
	/// stream to send normal messages too
	virtual std::ostream & message() = 0;

	/// stream to send warning messages too
	virtual std::ostream & warning() = 0;

	/// stream to send debug messages too
	virtual std::ostream & debug() = 0 ;

	static Console *instance;
}; // class Console

} // namespace common

#endif // __INCLUDED_CONSOLE_H__