Class Channel_Buffer

Description

Channel buffer based on a database

Channel buffer based on a database

  • version: $Id: class.Channel_Buffer_DB.inc,v 1.48 2003/10/18 08:39:03 letreo Exp $
  • access: public
  • author: Michael Oertel <michael@ortelius.de>

Located in /include/class.Channel_Buffer_DB.inc (line 55)


	
			
Variable Summary
 string $channel
 string $channel_id
 object $db
 mixed $locked
 dbRecordSet $rs_channels
 dbRecordSet $rs_line_buffer
 int $sem_id
 file $_fp
Method Summary
 Channel_Buffer Channel_Buffer (string $channel)
 void connect ()
 void destroy ()
 void disconnect ()
 void get_cur_line ()
 void get_lines_since (int $since_idx)
 void get_name ()
 boolean init ([string $name = null])
 void lock ()
 void put_line (object $line)
 void set_max_line_idx (int $max_line_idx)
 void test ()
 void unlock ()
Variables
string $channel (line 62)
string $channel_id (line 124)

channel id 32-bit based on channel name

channel id 32-bit based on channel name needed for shared memory and semaphores

integer $connection_count = 0 (line 106)
int $cur_line_idx (line 78)
object $db (line 85)
mixed $locked = false (line 136)
int $max_line_idx (line 70)
dbRecordSet $rs_channels (line 99)
dbRecordSet $rs_line_buffer (line 92)
int $sem_id (line 135)

Semaphore Id for channel buffer locking

Semaphore Id for channel buffer locking

file $_fp = null (line 114)
Methods
Constructor Channel_Buffer (line 146)

Constructor.

Constructor. create a new channel buffer object with name 'channel'

  • access: public
Channel_Buffer Channel_Buffer (string $channel)
  • string $channel: channel name
connect (line 372)

Connect to the database

Connect to the database Establish a database connection

  • access: public
void connect ()
destroy (line 354)

Destroys the channel buffer in database.

Destroys the channel buffer in database.

void destroy ()
disconnect (line 400)

Disconnect the database

Disconnect the database

void disconnect ()
get_cur_line (line 228)

Get content of current chat line.

Get content of current chat line.

  • access: public
void get_cur_line ()
get_cur_line_idx (line 204)

Get var cur_line_idx.

Get var cur_line_idx.

  • access: public
void get_cur_line_idx ()
get_lines_since (line 418)

Gets the chat lines since a given line index

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 161)

Get var max_line_idx.

Get var max_line_idx.

  • return: of buffer
  • access: public
int get_max_line_idx ()
get_name (line 218)

Get channel name.

Get channel name.

  • access: public
void get_name ()
init (line 247)

Initialize the channel buffer in database.

Initialize the channel buffer in database.

  • access: public
boolean init ([string $name = null])
  • string $name: name of channel
lock (line 278)

Set a lock to block all other threads.

Set a lock to block all other threads. Creates and sets a lock on a dummy file to perform a simple reader/writer model

void lock ()
put_line (line 461)

Writes chat lines into the buffer

Writes chat lines into the buffer

  • access: public
void put_line (object $line)
  • object $line
set_max_line_idx (line 178)

Set var max_line_idx.

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 506)

test class Channel_Buffer

test class Channel_Buffer call like: Channel_Buffer::test();

void test ()
unlock (line 330)

Unlock the dummy file.

Unlock the dummy file.

void unlock ()

Documentation generated on Tue, 29 Jun 2004 14:41:50 +0200 by phpDocumentor 1.3.0RC3