#include <Stream.h>
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 ¶ms=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 Params & | getParams () const |
void | setCP (ptr< CP > cp) |
ptr< CP > | getCP () |
|
A description of how to provide the schema in an XML representation of a stream.
|
|
Constructs a stream with a given name and tuple description.
|
|
Destructor.
|
|
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. |
|
Adds a TupleQueue not associated with a box. Whenever a tuple is written to this stream, the tuple will be copied into the TupleQueue. |
|
Returns a string representation of the stream.
|
|
Returns an XML representation of the stream.
|
|
|
|
Returns an EnqIterator for the stream.
|
|
|
|
Returns a vector of all box input ports attached to the stream.
|
|
Returns the name of the stream.
|
|
Returns the number of tuples that have ever been enqueued into this Stream.
|
|
|
|
Returns a vector of all TupleQueues attached to the stream.
|
|
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. |
|
Returns the stream's description.
|
|
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. |
|
Removes an input port of a box.
|
|
Removes a TupleQueue.
|
|
|
|
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. |
|
|