## Class Channel_Buffer

Description

Channel buffer based on a database

- version: $Id: class.Channel_Buffer_DB.inc,v 1.46 2003/04/02 17:39:28 letreo Exp $
- access: public
- author: Michael Oertel <michael@ortelius.de>

Located in Program_Root/include/class.Channel_Buffer_DB.inc (line 53)

Variable Summary
string $channel
integer $connection_count
int $cur_line_idx
mixed $locked
int $max_line_idx
Method Summary
void Channel_Buffer (string $channel)
void connect ()
void destroy ()
void disconnect ()
void get_cur_line ()
void get_cur_line_idx ()
void get_lines_since (int $since_idx)
int get_max_line_idx ()
void get_name ()
void init ()
void lock ()
void put_line (object $line)
void set_max_line_idx (int $max_line_idx)
void test ()
void unlock ()
Variables
string $channel (line 60)

- see: Channel_Buffer::Channel_Buffer()
- access: public

integer $connection_count (line 104)

- see: Channel_Buffer::disconnect()
- see: Channel_Buffer::connect()

int $cur_line_idx (line 76)

- see: Channel_Buffer::get_lines_since()
- see: Channel_Buffer::Channel_Buffer()
- access: public

mixed $locked = false (line 134)
int $max_line_idx (line 68)

- see: Channel_Buffer::get_lines_since()
- see: Channel_Buffer::Channel_Buffer()
- access: public

Methods
Constructor Channel_Buffer (line 144)

Constructor.

create a new channel buffer object with name 'channel'

- access: public

void Channel_Buffer (string $channel)

- string $channel: channel name

connect (line 367)

Connect to the database

Establish a database connection

- access: public

void connect ()
destroy (line 349)

Destroys the channel buffer in database.

- see: Channel_Buffer::init()
- access: public

void destroy ()
disconnect (line 395)

Disconnect the database

- see: Channel_Buffer::connect()
- access: public

void disconnect ()
get_cur_line (line 226)

Get content of current chat line.

- access: public

void get_cur_line ()
get_cur_line_idx (line 202)

Get var cur_line_idx.

- access: public

void get_cur_line_idx ()
get_lines_since (line 413)

Gets the chat lines since a given line index

- access: public

void get_lines_since (int $since_idx)

- int $since_idx

get_max_line_idx (line 159)

Get var max_line_idx.

- return: $max_line_idx of buffer
- access: public

int get_max_line_idx ()
get_name (line 216)

Get channel name.

- access: public

void get_name ()
init (line 243)

Initialize the channel buffer in database.

- access: public

void init ()
lock (line 273)

Set a lock to block all other threads.

Creates and sets a lock on a dummy file to perform a simple reader/writer model

- see: Channel_Buffer::unlock()
- access: public

void lock ()
put_line (line 456)

Writes chat lines into the buffer

- access: public

void put_line (object $line)

- object $line

set_max_line_idx (line 176)

Set var max_line_idx.

It is only a dummy. To change the size of the line buffer, simply add another column like 'line_27'

- access: public

void set_max_line_idx (int $max_line_idx)

- int $max_line_idx

test (line 501)

test class Channel_Buffer

call like: Channel_Buffer::test();

void test ()
unlock (line 325)

Unlock the dummy file.

- see: Channel_Buffer::lock()
- access: public

void unlock ()

Documention generated on Fri, 2 May 2003 10:50:41 +0200 by phpDocumentor 1.2.0rc2