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

Stream Class Reference

#include <Stream.h>

List of all members.


Detailed Description

A flow of tuples, all with the same type.

A stream is connected to zero or more TupleQueues and zero or more QBoxes. Whenever a tuple is written to the stream, it is multicasted to each of these TupleQueues and QBoxes.

This class is not thread-safe.


Public Types

enum  SchemaRepresentation { SCHEMA_NAME, FULL_SCHEMA_IF_ANONYMOUS, FULL_SCHEMA }
 A description of how to provide the schema in an XML representation of a stream. More...

Public Member Functions

 Stream (string name, const TupleDescription &desc, AuroraNode &node, const Params &params=Params()) throw (AuroraException)
 Constructs a stream with a given name and tuple description.
 ~Stream ()
 Destructor.
string getName () const
 Returns the name of the stream.
size_t getNumTuplesEnqueued () const
 Returns the number of tuples that have ever been enqueued into this Stream.
const TupleDescription & getTupleDescription () const
 Returns the stream's description.
void addQueue (TupleQueue *q)
 Adds a TupleQueue not associated with a box.
void removeQueue (TupleQueue *)
 Removes a TupleQueue.
const vector< TupleQueue * > & getQueues ()
 Returns a vector of all TupleQueues attached to the stream.
void addDestPort (QBoxInputPort port)
 Adds an input port of a box.
void removeDestPort (QBoxInputPort port)
 Removes an input port of a box.
const vector< QBoxInputPort > & getDestPorts ()
 Returns a vector of all box input ports attached to the stream.
void setSourcePort (QBoxOutputPort port)
 Specifies the box output port that is feeding input tuples to this stream.
QBoxOutputPort getSourcePort ()
 Returns the box output port that is feeding input tuples to this stream.
EnqIterator enq_iterator ()
 Returns an EnqIterator for the stream.
string as_string () const
 Returns a string representation of the stream.
string as_xml (SchemaRepresentation rep=FULL_SCHEMA_IF_ANONYMOUS) const
 Returns an XML representation of the stream.
void notifyEnq ()
 Calls the notifyEnq() method for each TupleQueue attached to this stream (including TupleQueues belonging to box's input ports).
void beginBuffering ()
void stopBuffering ()
const ParamsgetParams () const
void setCP (ptr< CP > cp)
ptr< CPgetCP ()


Member Enumeration Documentation

enum Stream::SchemaRepresentation
 

A description of how to provide the schema in an XML representation of a stream.

Enumeration values:
SCHEMA_NAME  Provide the schema name only.
FULL_SCHEMA_IF_ANONYMOUS  Provide the full schema if the stream is anonymous, else just the schema name.
FULL_SCHEMA  Always provide the full schema of the stream.


Constructor & Destructor Documentation

Stream::Stream string  name,
const TupleDescription &  desc,
AuroraNode node,
const Params params = Params()
throw (AuroraException)
 

Constructs a stream with a given name and tuple description.

Stream::~Stream  ) 
 

Destructor.


Member Function Documentation

void Stream::addDestPort QBoxInputPort  port  ) 
 

Adds an input port of a box.

Whenever a tuple is written to this stream, the tuple will be provided to the TupleQueue corresponding to that input port.

void Stream::addQueue TupleQueue q  ) 
 

Adds a TupleQueue not associated with a box.

Whenever a tuple is written to this stream, the tuple will be copied into the TupleQueue.

string Stream::as_string  )  const
 

Returns a string representation of the stream.

string Stream::as_xml SchemaRepresentation  rep = FULL_SCHEMA_IF_ANONYMOUS  )  const
 

Returns an XML representation of the stream.

void Stream::beginBuffering  ) 
 

EnqIterator Stream::enq_iterator  ) 
 

Returns an EnqIterator for the stream.

ptr< CP > Stream::getCP  ) 
 

const vector<QBoxInputPort>& Stream::getDestPorts  ) 
 

Returns a vector of all box input ports attached to the stream.

string Stream::getName  )  const
 

Returns the name of the stream.

size_t Stream::getNumTuplesEnqueued  )  const
 

Returns the number of tuples that have ever been enqueued into this Stream.

const Params& Stream::getParams  )  const
 

const vector<TupleQueue*>& Stream::getQueues  ) 
 

Returns a vector of all TupleQueues attached to the stream.

QBoxOutputPort Stream::getSourcePort  ) 
 

Returns the box output port that is feeding input tuples to this stream.

May be an empty QBoxOutputPort, in which case no box precedes this stream in the catalog, i.e., this is an input stream.

const TupleDescription& Stream::getTupleDescription  )  const
 

Returns the stream's description.

void Stream::notifyEnq  ) 
 

Calls the notifyEnq() method for each TupleQueue attached to this stream (including TupleQueues belonging to box's input ports).

This notifies any listeners on those TupleQueues that tuples may be ready for consumption.

void Stream::removeDestPort QBoxInputPort  port  ) 
 

Removes an input port of a box.

void Stream::removeQueue TupleQueue  ) 
 

Removes a TupleQueue.

void Stream::setCP ptr< CP cp  ) 
 

void Stream::setSourcePort QBoxOutputPort  port  ) 
 

Specifies the box output port that is feeding input tuples to this stream.

An empty QBoxOutputPort may be used to specify that no box precedes this stream in the catalog, i.e., this is an input stream.

void Stream::stopBuffering  ) 
 


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