]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/console.h
Use an enum rather than plain integers to distinguish Console instances
[libs/core.git] / source / io / console.h
index 54774323558a905d8dbe416114d932fd5e279d83..5b4158fc90b533a96d7399da08d41d45b7887b30 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef MSP_IO_CONSOLE_H_
 #define MSP_IO_CONSOLE_H_
 
-#include "base.h"
+#include "eventobject.h"
 #include "handle.h"
 
 namespace Msp {
@@ -12,12 +12,21 @@ Provides access to standard input, output and error streams.  This class can't
 be instantiated directly - use one of the cin, cout and cerr references
 instead.
 */
-class Console: public Base
+class Console: public EventObject
 {
+public:
+       enum Stream
+       {
+               INPUT = 0,
+               OUTPUT = 1,
+               ERROR = 2
+       };
+
 private:
+       Stream stream;
        Handle handle;
 
-       Console(unsigned);
+       Console(Stream);
 public:
        ~Console();
 
@@ -44,7 +53,7 @@ protected:
 public:
        virtual const Handle &get_event_handle() { return handle; }
 
-       static Console &instance(unsigned);
+       static Console &instance(Stream);
 };
 
 extern Console &cin;