Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

StreamBuffer Class Reference

#include <StreamBuffer.h>

List of all members.


Detailed Description

Circular buffer to hold input and output tuples.

Should be replaced by connection points once they become available.


Public Member Functions

 StreamBuffer (Name name)
 ~StreamBuffer ()
string as_string () const
string repr () const
void init_buffer (int tuple_size)
 Initialize the buffer of tuples.
void reset_next ()
 Reset the cursor to the beginning of the buffer.
void buffer (const char *new_tuples, int length, int tuple_size)
 Buffer tuples produced on this stream.
bool is_duplicate (string tuple)
char * first_new (char *buffer, int buffer_size)
 In a buffer partially filled with duplicates, finds the location of the last tuple in this.m_bin_tuples and returns a pointer to the first tuple following it Assumes the tuples in the buffer given as parameter have the same size as the tuples in our buffer.
ptr< StreamEvent > all_tuples_since (string first_tuple=string())
 Produces a StreamEvent from the content of the buffer Only take all tuples succeeding first_tuple.
ptr< StreamEvent > all_tuples_before (string last_tuple=string())
 Produces a StreamEvent from all tuples between m_begin and the tuple given in parameters.
ptr< StreamEvent > next_tuples ()
 Produces a StreamEvent from all tuples that were buffered since the last time we called buffer_next_end_as_event Advances m_next to m_end.
string last_tuple ()
void trim (string tuple)
 Trims queue iff finds a tuple identical to the one given as parameter.


Constructor & Destructor Documentation

BOREALIS_NAMESPACE_BEGIN StreamBuffer::StreamBuffer Name  name  ) 
 

StreamBuffer::~StreamBuffer  ) 
 


Member Function Documentation

ptr< StreamEvent > StreamBuffer::all_tuples_before string  last_tuple = string()  ) 
 

Produces a StreamEvent from all tuples between m_begin and the tuple given in parameters.

If the tuple is not given or is not found then uses all tuples between m_begin and m_end

ptr< StreamEvent > StreamBuffer::all_tuples_since string  first_tuple = string()  ) 
 

Produces a StreamEvent from the content of the buffer Only take all tuples succeeding first_tuple.

If first_tuple is not specified then return all the tuples in the buffer. If first_tuple is not in the buffer then return an empty set of tuples

string StreamBuffer::as_string  )  const
 

void StreamBuffer::buffer const char *  new_tuples,
int  length,
int  tuple_size
 

Buffer tuples produced on this stream.

char * StreamBuffer::first_new char *  buffer,
int  buffer_size
 

In a buffer partially filled with duplicates, finds the location of the last tuple in this.m_bin_tuples and returns a pointer to the first tuple following it Assumes the tuples in the buffer given as parameter have the same size as the tuples in our buffer.

Returns:
pointer to the tuple following the last tuple in this.m_bin_tuples

void StreamBuffer::init_buffer int  tuple_size  ) 
 

Initialize the buffer of tuples.

bool StreamBuffer::is_duplicate string  tuple  ) 
 

Returns:
true if this tuple is already in the buffer

string StreamBuffer::last_tuple  ) 
 

Returns:
the last tuple produced/received on the stream

ptr< StreamEvent > StreamBuffer::next_tuples  ) 
 

Produces a StreamEvent from all tuples that were buffered since the last time we called buffer_next_end_as_event Advances m_next to m_end.

string StreamBuffer::repr  )  const
 

void StreamBuffer::reset_next  ) 
 

Reset the cursor to the beginning of the buffer.

void StreamBuffer::trim string  tuple  ) 
 

Trims queue iff finds a tuple identical to the one given as parameter.

If not then does not do anything


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 15:15:24 2004 for Borealis by doxygen 1.3.8