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>2008-01-30 17:34:35 +0000
committerStijn Buys <ingar@osirion.org>2008-01-30 17:34:35 +0000
commit69f7ffa70863bef2be4cae08c466b5d97a627277 (patch)
tree9945e1c5cb29e10afda66af3274c3ef87886225a /src/common/console.h
parenta94049b1a43f83d750b9b5dee031c19a6b1fafb0 (diff)
accomodate the new modules
Diffstat (limited to 'src/common/console.h')
-rw-r--r--src/common/console.h51
1 files changed, 32 insertions, 19 deletions
diff --git a/src/common/console.h b/src/common/console.h
index b661afc..fbda5da 100644
--- a/src/common/console.h
+++ b/src/common/console.h
@@ -1,47 +1,60 @@
/*
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
+ 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__
+#ifndef __INCLUDED_COMMON_CONSOLE_H__
+#define __INCLUDED_COMMON_CONSOLE_H__
+
+// project headers
+#include "common/common.h"
// C++ headers
#include <iostream>
/// global define to send a message to the system console
-#define conmesg common::Console::instance->message()
+#define con_print common::Console::instance()->messagestream()
/// global define to send a warning message to the system console
-#define conwarn common::Console::instance->warning()
-
-#define DEBUG 1
+#define con_warn common::Console::instance()->warningstream()
-#ifdef DEBUG
+#ifdef HAVE_DEBUG_MESSAGES
/// global define to send a debug message to the system console
-#define condebug common::Console::instance->debug()
+#define con_debug common::Console::instance()->debugstream()
#else
-#define condebug if (0) *(std::ostream*)(0)
-#endif // DEBUG
+#define con_debug if (0) *(std::ostream*)(0)
+#endif
namespace common {
-/// Interface for a console object that writes messages on the screen
+/// interface for a console object that writes messages on the screen
class Console {
public:
+ /// default constructor
+ Console();
+
+ /// default destructor
+ virtual ~Console();
+
/// stream to send normal messages too
- virtual std::ostream & message() = 0;
+ virtual std::ostream & messagestream() = 0;
/// stream to send warning messages too
- virtual std::ostream & warning() = 0;
+ virtual std::ostream & warningstream() = 0;
/// stream to send debug messages too
- virtual std::ostream & debug() = 0 ;
+ virtual std::ostream & debugstream() = 0;
+
+ /// a pointer to the current console implementation
+ static Console *instance();
- static Console *instance;
-}; // class Console
+private:
+ /// console singleton
+ static Console *console_instance;
+}
+; // class Console
} // namespace common
-#endif // __INCLUDED_CONSOLE_H__
+#endif // __INCLUDED_COMMON_CONSOLE_H__