SMP::SMPBuffer Class Reference

Data type communication channel class The default buffer type. More...

#include <buffer.h>

Inheritance diagram for SMP::SMPBuffer:

Inheritance graph
[legend]
Collaboration diagram for SMP::SMPBuffer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SMPBuffer (void)
 SMPBuffer (size_t buf_size)
 constructor, initialize the buffer with user-defined size
 ~SMPBuffer (void)
void initialize ()
void set_status (int b_status)
 set buffer status
int get_status (void)
 get buffer status
size_t available (void)
 Return the remaining spaces of the buffer.
ssize_t read_space (int fid)
size_t occuppied (void)
 Return the occuppied spaces of the buffer.
size_t occuppied (int fid)
 return the occuppied spaces of the buffer, whose destination is filter of id = fid
int write (const void *buff, size_t nbytes)
 write data to this buffer
int read (void *buff, size_t nbytes, int fid=0)
 read data from this buffer
void print_status (int nbytes=0)
 print buffer status to stdout

Friends

class SMPKernel

Detailed Description

Data type communication channel class The default buffer type.


Constructor & Destructor Documentation

SMP::SMPBuffer::SMPBuffer ( void   ) 

default constructor

SMP::SMPBuffer::SMPBuffer ( size_t  buf_size  ) 

constructor, initialize the buffer with user-defined size

Parameters:
buf_size user-defined buffer size, in bytes

SMP::SMPBuffer::~SMPBuffer ( void   ) 

destructor


Member Function Documentation

void SMP::SMPBuffer::initialize (  ) 

initialize this data channel

void SMP::SMPBuffer::set_status ( int  b_status  )  [inline]

set buffer status

Parameters:
b_status the status to set

size_t SMP::SMPBuffer::available ( void   )  [inline]

Return the remaining spaces of the buffer.

Returns:
number of bytes available

ssize_t SMP::SMPBuffer::read_space ( int  fid  ) 

return the available space for filter fid to read

size_t SMP::SMPBuffer::occuppied ( void   )  [inline]

Return the occuppied spaces of the buffer.

Returns:
number of bytes occuppied

size_t SMP::SMPBuffer::occuppied ( int  fid  )  [inline]

return the occuppied spaces of the buffer, whose destination is filter of id = fid

Returns:
number of bytes occuppied

int SMP::SMPBuffer::write ( const void *  buff,
size_t  nbytes 
)

write data to this buffer

Parameters:
buff the data to write
nbytes number of bytes to write
Warning:
nbytes should not be larger than the buffer's size

int SMP::SMPBuffer::read ( void *  buff,
size_t  nbytes,
int  fid = 0 
)

read data from this buffer

Parameters:
buff the data to place read data
nbytes number of bytes to read
fid read data, whose destination filter's id = fid
Warning:
nbytes should not be larger than the buffer's size

void SMP::SMPBuffer::print_status ( int  nbytes = 0  ) 

print buffer status to stdout

Parameters:
nbytes number of bytes written to from read from this buffer if not specified, it simply doesn't print it.
Note:
common use --> print_status();


Friends And Related Function Documentation

friend class SMPKernel [friend]

SMPKernel is a friend of SMPBuffer, so SMP kernel can directly access all members defined here

Reimplemented from SMP::SMPBufferBase.


The documentation for this class was generated from the following files:
Generated on Fri Aug 31 15:41:57 2007 for SCREAMLinuxMiddleware(SLIM) by  doxygen 1.5.1