Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Console Class Reference

The abstract interface for a text I/O console. More...

#include <console.h>

Inheritance diagram for Console:

Console_buffer Filter_console Jdb_gzip Kdb_cons Keyb Mux_console Push_console Uart Vga_console List of all members.

Public Types

enum  Console_state { DISABLED = 0, INENABLED = 1, OUTENABLED = 2 }
enum  Console_attr {
  INVALID = 0, OUT = 0x1, IN = 0x2, DIRECT = 0x4,
  UART = 0x8, UX = 0x10, PUSH = 0x20, GZIP = 0x40,
  BUFFER = 0x80, DEBUG = 0x100
}

Public Member Functions

virtual void state (Mword new_state)
 modify console state
virtual int write (char const *str, size_t len)
 Write a string of len chacters to the output.
virtual int getchar (bool blocking=true)
 read a charcater from the input.
virtual int char_avail () const
 Is input available?
virtual Mword get_attributes () const
 Console attributes.
virtual ~Console ()
Mword state () const
 get current console state
const char * str_mode () const
const char * str_state () const
const char * str_attr (Mword bit) const

Static Public Member Functions

static void disable_all ()
 Disables the stdout, stdin, and stderr console.

Static Public Attributes

static Consolestdout = 0
 stdout for libc glue.
static Consolestderr = 0
 stderr for libc glue.
static Consolestdin = 0
 stdin for libc glue.

Protected Attributes

Mword _state

Detailed Description

The abstract interface for a text I/O console.

This abstract interface can be implemented for virtually every text input or output device.


Member Enumeration Documentation

enum Console::Console_attr
 

Enumeration values:
INVALID 
OUT  output to console is possible
IN  input from console is possible
DIRECT  output to screen or input from keyboard
UART  output to/input from serial serial line
UX  filtered input console for UX
PUSH  input console
GZIP  gzip+uuencode output and sent to uart console
BUFFER  ring buffer
DEBUG  kdb interface

enum Console::Console_state
 

Enumeration values:
DISABLED 
INENABLED  output channel of console enabled
OUTENABLED  input channel of console enabled


Constructor & Destructor Documentation

Console::~Console  )  [virtual]
 


Member Function Documentation

int Console::char_avail  )  const [virtual]
 

Is input available?

This method can be implemented. It must return -1 if no information is available, 1 if at least one character is avialable, and 0 if no charachter is available.

Reimplemented in Filter_console, Kdb_cons, Mux_console, Push_console, and Uart.

void Console::disable_all  )  [static]
 

Disables the stdout, stdin, and stderr console.

Mword Console::get_attributes  )  const [virtual]
 

Console attributes.

Reimplemented in Filter_console, Console_buffer, Jdb_gzip, Kdb_cons, Keyb, Mux_console, Push_console, Uart, and Vga_console.

int Console::getchar bool  blocking = true  )  [virtual]
 

read a charcater from the input.

Parameters:
blocking if true getchar blocks til a charcater is available.
This method must be implemented in every implementation, but can simply return -1 for output only consoles.

Reimplemented in Filter_console, Console_buffer, Kdb_cons, Kconsole, Keyb, Mux_console, Push_console, Uart, and Vga_console.

Mword Console::state  )  const [inline]
 

get current console state

void Console::state Mword  new_state  )  [virtual]
 

modify console state

Reimplemented in Jdb_gzip.

const char * Console::str_attr Mword  bit  )  const
 

const char * Console::str_mode  )  const
 

const char * Console::str_state  )  const
 

int Console::write char const *  str,
size_t  len
[virtual]
 

Write a string of len chacters to the output.

Parameters:
str the string to write (no zero termination is needed)
len the number of chacters to write.
This method must be implemented in every implementation, but can simply do nothing for input only consoles.

Reimplemented in Filter_console, Console_buffer, Jdb_gzip, Kdb_cons, Keyb, Mux_console, Push_console, Uart, and Vga_console.


Member Data Documentation

Mword Console::_state [protected]
 

Console * Console::stderr = 0 [static]
 

stderr for libc glue.

Console * Console::stdin = 0 [static]
 

stdin for libc glue.

Console * Console::stdout = 0 [static]
 

stdout for libc glue.


The documentation for this class was generated from the following files:
Generated on Mon Sep 26 14:20:14 2005 for Fiasco by  doxygen 1.4.2