00001
00003 #ifndef _das2_stream_h_
00004 #define _das2_stream_h_
00005
00006 #include <stdbool.h>
00007 #include <das2/packet.h>
00008
00009 #define STREAMDESC_CMP_SZ 48
00010 #define STREAMDESC_VER_SZ 48
00011
00017 typedef struct stream_descriptor{
00019 Descriptor base;
00020
00030 PktDesc* pktDesc[100];
00031
00032
00033 char compression[STREAMDESC_CMP_SZ];
00034 char version[STREAMDESC_VER_SZ];
00035 bool bDescriptorSent;
00036
00044 void* pUser;
00045 } StreamDesc;
00046
00047
00054 StreamDesc* new_StreamDesc(void);
00055
00056 StreamDesc* new_StreamDesc_str(DasBuf* pBuf);
00057
00071 StreamDesc* StreamDesc_copy(const StreamDesc* pThis);
00072
00073
00079 void del_StreamDesc(StreamDesc* pThis);
00080
00095 size_t StreamDesc_getNPktDesc(const StreamDesc* pThis);
00096
00106 ErrorCode StreamDesc_addPktDesc(StreamDesc* pThis, PktDesc* pPd, int nPktId);
00107
00108
00113 void StreamDesc_setMonotonic(StreamDesc* pThis, bool isMonotonic );
00114
00120 void StreamDesc_addStdProps(StreamDesc* pThis);
00121
00126 void StreamDesc_addCmdLineProp(StreamDesc* pThis, int argc, char* argv[] );
00127
00151 PktDesc* StreamDesc_createPktDesc(StreamDesc* pThis, DasEncoding* pXEncoder,
00152 UnitType xUnits );
00153
00165 PktDesc* StreamDesc_clonePktDesc(StreamDesc* pThis, const PktDesc* pd);
00166
00179 PktDesc* StreamDesc_clonePktDescById(
00180 StreamDesc* pThis, const StreamDesc* pOther, int nPktId
00181 );
00182
00190 bool StreamDesc_isValidId(const StreamDesc* pThis, int nPktId);
00191
00201 PktDesc* StreamDesc_getPktDesc(const StreamDesc* pThis, int id);
00202
00207 ErrorCode StreamDesc_freePktDesc(StreamDesc* pThis, int nPktId);
00208
00212 int StreamDesc_getOffset(StreamDesc* pThis);
00213
00221 ErrorCode StreamDesc_encode(StreamDesc* pThis, DasBuf* pBuf);
00222
00228 Descriptor* Das2Desc_decode(DasBuf* pBuf);
00229
00230 #endif