[ PHPXref.com ] [ Generated: Sun Jul 20 19:52:25 2008 ] [ PHPOpenChat 3.0.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/include/ -> class.Channel_Buffer_Mem.inc (summary)

(no description)

File Size: 472 lines (14 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 include/class.Logger.inc
 config.inc.php

Defines 1 class

POC_Channel_Buffer:: (17 methods):
  POC_Channel_Buffer()
  get_max_line_idx()
  get_cur_line_idx()
  get_name()
  lock()
  unlock()
  remove_lock()
  connect()
  disconnect()
  init()
  mkclean()
  destroy()
  get_cur_line()
  get_lines_since()
  get_all_lines_in_buffer()
  put_line()
  test()


Class: POC_Channel_Buffer  - X-Ref

Channel buffer based on shared memory

POC_Channel_Buffer($channel)   X-Ref
Constructor

create a new channel buffer object with name 'channel'

param: string $channel

get_max_line_idx()   X-Ref
Get maximum line index

return: int max_line_idx

get_cur_line_idx()   X-Ref
Get current line index

return: int cur_line_idx

get_name()   X-Ref
Get channel name

return: string channel

lock()   X-Ref
Lock access to shared memory with a semaphore

Semaphore is created by connect()

return: int semaphore id

unlock()   X-Ref
Unlock access to shared memory with a semaphore

To remove sempahore use remove_lock()

return: int semaphore id

remove_lock()   X-Ref
Remove lock semaphore
TODO: Test if really needed and working, fm

return: int semaphore id

connect()   X-Ref
Connect to the shared memory segment

Create semaphore and shared memory segment if non-existant
Init if created

param: string

disconnect()   X-Ref
No description

init()   X-Ref
No description

mkclean()   X-Ref
Cleans up the channel buffer in database.


destroy()   X-Ref
No description

get_cur_line()   X-Ref
Get current chat line object

return: object Line

get_lines_since($since_idx)   X-Ref
Get all chat lines since given index

Idea is get all lines that were written by others
since the last line you have written

param: int $since_idx
return: array of instances of class Chat_Line

get_all_lines_in_buffer()   X-Ref
Provides all lines within the buffer

param: int $since_idx
return: array of instances of class Chat_Line

put_line($line)   X-Ref
No description

test()   X-Ref
test method for class Channel_Buffer

call like: POC_Channel_Buffer::test();
initialize 2 channel buffers, write some lines
read them, disconnect and reconnect,
and verify the lines again
test function must work identical in Mem and DB version



[ Powered by PHPXref - Served by Debian GNU/Linux ]