Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2007-10-22 17:44:54 +0000
committerStijn Buys <ingar@osirion.org>2007-10-22 17:44:54 +0000
commit8a4aa60b830467d81f8029c194bec5b2e74ceb17 (patch)
treea32662287892a41ffa7fd55ab2d80f6040dedfb9 /src/common/console.h
parentaa33bc22ec4cd14e200ba9e09c43e884a2101a74 (diff)
basic system console (new files)
Diffstat (limited to 'src/common/console.h')
-rw-r--r--src/common/console.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/common/console.h b/src/common/console.h
new file mode 100644
index 0000000..609c99a
--- /dev/null
+++ b/src/common/console.h
@@ -0,0 +1,40 @@
+/*
+ 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()
+/// global define to send a debug message to the system console
+#define condebug common::Console::instance->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__
+