00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef Fennel_ExecStreamDefs_Included
00025 #define Fennel_ExecStreamDefs_Included
00026
00027 #include "fennel/tuple/TupleDescriptor.h"
00028 #include "fennel/segment/SegmentAccessor.h"
00029
00030 FENNEL_BEGIN_NAMESPACE
00031
00036 typedef uint ExecStreamId;
00037
00038 enum ExecStreamBufState
00039 {
00040 EXECBUF_EMPTY,
00041 EXECBUF_NONEMPTY,
00042 EXECBUF_UNDERFLOW,
00043 EXECBUF_OVERFLOW,
00044 EXECBUF_EOS
00045 };
00046
00047 static std::string ExecStreamBufState_names[] = {
00048 "EXECBUF_EMPTY",
00049 "EXECBUF_NONEMPTY",
00050 "EXECBUF_UNDERFLOW",
00051 "EXECBUF_OVERFLOW",
00052 "EXECBUF_EOS"
00053 };
00054
00055 static std::string ExecStreamBufState_names_short[] = {
00056 "EMP",
00057 "NEM",
00058 "UND",
00059 "OVR",
00060 "EOS"
00061 };
00062
00063 inline std::ostream & operator<< (std::ostream &os, ExecStreamBufState e)
00064 {
00065 return os << ExecStreamBufState_names[e];
00066 }
00067
00068 enum ExecStreamBufProvision
00069 {
00070 BUFPROV_NONE,
00071 BUFPROV_CONSUMER,
00072 BUFPROV_PRODUCER,
00073 };
00074
00075 enum ExecStreamResult
00076 {
00077 EXECRC_BUF_UNDERFLOW,
00078 EXECRC_BUF_OVERFLOW,
00079 EXECRC_EOS,
00080 EXECRC_QUANTUM_EXPIRED,
00081 EXECRC_YIELD
00082 };
00083
00084 static std::string ExecStreamResult_names[] = {
00085 "EXECRC_BUF_UNDERFLOW",
00086 "EXECRC_BUF_OVERFLOW",
00087 "EXECRC_EOS",
00088 "EXECRC_QUANTUM_EXPIRED",
00089 "EXECRC_YIELD"
00090 };
00091
00092 static std::string ExecStreamResult_names_short[] = {
00093 "UND",
00094 "OVR",
00095 "EOS",
00096 "QNT",
00097 "YLD"
00098 };
00099
00100 inline std::ostream & operator<< (std::ostream &os, ExecStreamResult e)
00101 {
00102 return os << ExecStreamResult_names[e];
00103 }
00104
00111 struct FENNEL_EXEC_EXPORT ExecStreamQuantum
00112 {
00116 uint nTuplesMax;
00117
00121 explicit ExecStreamQuantum()
00122 {
00123 nTuplesMax = MAXU;
00124 }
00125 };
00126
00131 enum ExecStreamResourceSettingType {
00135 EXEC_RESOURCE_ACCURATE,
00141 EXEC_RESOURCE_ESTIMATE,
00145 EXEC_RESOURCE_UNBOUNDED
00146 };
00147
00152 struct FENNEL_EXEC_EXPORT ExecStreamResourceQuantity
00153 {
00159 uint nThreads;
00160
00165 uint nCachePages;
00166
00167 explicit ExecStreamResourceQuantity()
00168 {
00169 nThreads = 0;
00170 nCachePages = 0;
00171 }
00172 };
00173
00177 struct FENNEL_EXEC_EXPORT ExecStreamParams
00178 {
00183 SharedCacheAccessor pCacheAccessor;
00184
00189 SegmentAccessor scratchAccessor;
00190
00191 explicit ExecStreamParams();
00192
00193 virtual ~ExecStreamParams();
00194 };
00195
00196 FENNEL_END_NAMESPACE
00197
00198 #endif
00199
00200