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

Mux_console Class Reference

Console multiplexer. More...

#include <mux_console.h>

Inheritance diagram for Mux_console:

Console Kconsole List of all members.

Public Types

enum  { SIZE = 8 }

Public Member Functions

int write (char const *str, size_t len)
 Write a string of len chacters to the output.
int getchar (bool blocking=true)
 read a charcater from the input.
int char_avail () const
 Is input available?
 Mux_console ()
Mword get_attributes () const
 deliver attributes of all subconsoles.
void getchar_chance ()
virtual bool register_console (Console *c, int pos=0)
 Register a console to be multiplexed.
bool unregister_console (Console *c)
 Unregister a console from the multiplexer.
void change_state (Mword any_true, Mword all_false, Mword mask, Mword bits)
 Change the state of a group of consoles specified by attributes.
Consolefind_console (Mword any_true)
 Find a console with a specific attribute.
void start_exclusive (Mword any_true)
 Start exclusive mode for a specific console.
void end_exclusive (Mword any_true)
 End exclusive mode for a specific console.
void list_consoles ()

Private Attributes

int _next_getchar
int _items
Console_cons [SIZE]

Detailed Description

Console multiplexer.

This implementation of the Console interface can be used to multiplex among some input, output, and in-out consoles.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
SIZE  The maximum number of consoles to be multiplexed.


Constructor & Destructor Documentation

Mux_console::Mux_console  ) 
 


Member Function Documentation

void Mux_console::change_state Mword  any_true,
Mword  all_false,
Mword  mask,
Mword  bits
 

Change the state of a group of consoles specified by attributes.

Parameters:
any_true match if console has any of these attributes
all_false match if console doesn't have any of these attributes

int Mux_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 from Console.

void Mux_console::end_exclusive Mword  any_true  ) 
 

End exclusive mode for a specific console.

Parameters:
any_true match to console which has set any bit of this bitmask

Console * Mux_console::find_console Mword  any_true  ) 
 

Find a console with a specific attribute.

Parameters:
any_true match to console which has set any bit of this bitmask

Mword Mux_console::get_attributes  )  const [virtual]
 

deliver attributes of all subconsoles.

Reimplemented from Console.

int Mux_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 from Console.

Reimplemented in Kconsole.

void Mux_console::getchar_chance  ) 
 

Reimplemented in Kconsole.

void Mux_console::list_consoles  ) 
 

bool Mux_console::register_console Console c,
int  pos = 0
[virtual]
 

Register a console to be multiplexed.

Parameters:
cons the Console to add.
pos the position of the console, normally not needed.

Reimplemented in Kconsole.

void Mux_console::start_exclusive Mword  any_true  ) 
 

Start exclusive mode for a specific console.

Only the one console which matches to any_true is enabled for input and output. All other consoles are disabled.

Parameters:
any_true match to console which has set any bit of this bitmask

bool Mux_console::unregister_console Console c  ) 
 

Unregister a console from the multiplexer.

Parameters:
cons the console to remove.

int Mux_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 from Console.


Member Data Documentation

Console* Mux_console::_cons[SIZE] [private]
 

int Mux_console::_items [private]
 

int Mux_console::_next_getchar [private]
 


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