00001 /* Copyright (c) 2006, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 */ 00007 00008 #ifndef _SK_IO_TTYDEVICE_ 00009 #define _SK_IO_TTYDEVICE_ 00010 00011 #include <sk/util/Holder.hxx> 00012 #include <sk/io/DelegatingTty.h> 00013 #include <sk/io/TtyFileDescriptor.h> 00014 #include <sk/io/File.h> 00015 00016 namespace sk { 00017 namespace io { 00018 class TtyDevice 00019 : public sk::io::File, 00020 public virtual sk::io::DelegatingTty 00021 { 00022 public: 00023 TtyDevice(const sk::util::String& name); 00024 virtual ~TtyDevice(); 00025 00026 // sk::io::File reimplementation. 00027 void close(); 00028 sk::io::TtyFileDescriptor& getFileDescriptor() const; 00029 00030 // sk::io::DelegatingTty implementation. 00031 sk::io::Tty& getTty(); 00032 const sk::io::Tty& getTty() const; 00033 00034 // sk::util::Object re-implementation. 00035 const sk::util::Class getClass() const; 00036 00037 private: 00038 TtyDevice(const TtyDevice& other); 00039 TtyDevice& operator = (const TtyDevice& other); 00040 00041 sk::util::Holder<sk::io::TtyFileDescriptor> _descriptorHolder; 00042 }; 00043 } 00044 } 00045 00046 #endif /* _SK_IO_TTYDEVICE_ */