Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

StreamSink Class Reference
[Communications Facilities]

#include <StreamSink.hh>

List of all members.


Detailed Description

Class for receiving messages coming from stream sources.

This is a class for receiving messages from any number of remote stream sources. Any received message is acknowledged, and received messages are buffered until they are processed. Messages can either be polled for with pollData or blocked on with waitData.


Public Member Functions

 StreamSink (int max_size, com_id_t stream_id, int max_buffer, com_id_t exclusive_client=0)
MessagewaitData (int msecs_timeout)
MessagepollData ()
void releaseMsg (Message *)
int numToReceive ()
void setBufferSize (int b)
int getBufferSize () const
com_id_t exclusiveClient () const
int getMaxSize () const
com_id_t getID () const
void flush ()
void processMsg (com_id_t msg_id, RemoteManager *dest, TimeStamp receipt_time, Byte *buf, int len)


Member Function Documentation

void StreamSink::flush  ) 
 

This method flushes all messages in the queue waiting to be processed. All of the messages are released.

int StreamSink::getBufferSize  )  const [inline]
 

This method returns the maximum number of messages that can be in the queue waiting to be processed. A negative number indicates that there is no limit.

com_id_t StreamSink::getID  )  const [inline]
 

This method returns the stream ID.

int StreamSink::getMaxSize  )  const [inline]
 

This method returns the maximum size of the messages in the stream

int StreamSink::numToReceive  )  [inline]
 

This method returns the number of messages waiting to be received.

Message* StreamSink::pollData  ) 
 

This method checks if a new message has arrived. If so, it is returned, if not NULL is returned.

void StreamSink::setBufferSize int  b  )  [inline]
 

This method sets the maximum number of messages that can be in the queue waiting to be processed. If this maximum queue size is going to be exceeded, the stream sink will throw away the oldest pending message. If "b" is -1, there is no limit and this is the initial value if you never call this method.

Message* StreamSink::waitData int  msecs_timeout  ) 
 

This method waits for a message to arrive for up to "msecs_timeout" milliseconds and returns it. If no message arrives in that time, it returns NULL.


RHexLib Reference Documentation