00001 #ifndef SCONTROL_QBOX_H 00002 #define SCONTROL_QBOX_H 00003 00004 #include "QBox.h" 00005 #include "../ConsistencyMngr.h" // For the benchmark types 00006 00007 BOREALIS_NAMESPACE_BEGIN 00008 00014 class SControlQBox : public QBox { 00015 00016 public: 00017 void setupImpl() throw (AuroraException); 00018 void initImpl() throw (AuroraException); 00019 00020 protected: 00021 00022 static const int DATA_STREAM = 0; 00023 static const int CONTROL_STREAM = 1; 00024 static const int TWO_OUTPUTS = 2; 00025 00027 TupleDescription createControlOutputDescription(); 00028 00030 void emitTuple(const Tuple& src_tuple); 00031 00033 void emitTuple(const Tuple& undo_tuple, TupleType type); 00034 00036 void emitUndoRedoTuples(const Tuple& tuple); 00037 00039 void emitControlTuple(int stream_id, TupleType tuple_type, Timestamp tuple_data); 00040 00042 void emitControlTuple(TupleType tuple_type, Timestamp tuple_data); 00043 00045 void notifyOutputs(); 00046 00048 bool _output[TWO_OUTPUTS]; 00049 00051 unsigned int _output_tuple_size; 00052 unsigned int _control_tuple_size; 00053 00054 AURORA_DECLARE_QBOX(SControlQBox, "scontrol"); 00055 00056 }; 00057 00058 00059 BOREALIS_NAMESPACE_END 00060 00061 00062 #endif