23 #ifndef _das_stream_h_
24 #define _das_stream_h_
34 #define STREAM_MODEL_MIXED -1
35 #define STREAM_MODEL_V2 2
36 #define STREAM_MODEL_V3 3
38 #define STREAMDESC_CMP_SZ 48
39 #define STREAMDESC_VER_SZ 48
40 #define STREAMDESC_TYPE_SZ 48
42 #define MAX_PKTIDS 100
92 typedef struct das_stream{
105 DasDesc* descriptors[MAX_PKTIDS];
111 char compression[STREAMDESC_CMP_SZ];
112 char type[STREAMDESC_TYPE_SZ];
113 char version[STREAMDESC_VER_SZ];
114 bool bDescriptorSent;
132 #define StreamDesc DasStream
142 #define new_StreamDesc new_DasStream
146 #define new_StreamDesc_str new_DasStream_str
155 #define StreamDesc_info DasStream_info
172 #define StreamDesc_copy DasStream_copy
183 #define del_StreamDesc del_DasStream
203 #define StreamDesc_getNPktDesc DasStream_getNPktDesc
230 #define StreamDesc_nextPktDesc DasStream_nextPktDesc
250 #define StreamDesc_addPktDesc DasStream_addPktDesc
258 #define StreamDesc_setMonotonic DasStream_setMonotonic
267 #define StreamDesc_addStdProps DasStream_addStdProps
275 #define StreamDesc_addCmdLineProp DasStream_addCmdLineProp
304 #define StreamDesc_createPktDesc DasStream_createPktDesc
316 DasStream* pThis, ubyte
id,
const char* sName,
const char* sType
319 #define StreamDesc_createFrame DasStream_createFrame
327 #define StreamDesc_nextFrameId DasStream_nextFrameId
342 #define StreamDesc_clonePktDesc DasStream_clonePktDesc
360 #define StreamDesc_clonePktDescById DasStream_clonePktDescById
371 #define StreamDesc_isValidId DasStream_isValidId
384 #define StreamDesc_getPktDesc DasStream_getPktDesc
399 #define StreamDesc_getFrame DasStream_getFrame
404 #define StreamDesc_getNumFrames DasStream_getNumFrames
412 #define StreamDesc_getFrameId DasStream_getFrameId
422 const DasStream* pThis,
const char* sFrame
425 #define StreamDesc_getFrameByName DasStream_getFrameByName
436 #define StreamDesc_getFrameById DasStream_getFrameById
444 #define StreamDesc_freeDesc DasStream_freeSubDesc
451 #define StreamDesc_getOffset DasStream_getOffset
462 #define StreamDesc_encode DasStream_encode
Objects which define a iteration space.
int DasErrCode
return code type 0 indicates success, negative integer indicates failure
Definition: defs.h:164
const char * das_units
Handle SI and other units, with accommodations for Epoch systems, from units.h.
Definition: units.h:139
DAS_API bool DasStream_isValidId(const DasStream *pThis, int nPktId)
Check to see if an packet ID has been defined for the stream.
DAS_API DasDesc * DasDesc_decode(DasBuf *pBuf, DasStream *pSd, int nPktId, int nModel)
Packtized Stream Descriptor Factory Function.
DAS_API int DasStream_nextFrameId(const DasStream *pThis)
Get the next open frame ID.
DAS_API int8_t DasStream_getNumFrames(const DasStream *pThis)
Return the number of frames defined in the stream.
DAS_API int8_t DasStream_getFrameId(const DasStream *pThis, const char *sFrame)
Get a frame index given it's name.
Buffer class to handle accumulating byte streams.
Definition: buffer.h:47
Base structure for Stream Header Items.
Definition: descriptor.h:74
Reading and writing values to buffers.
Definition: encoding.h:108
Stores the definitions for a directional coordinate frame.
Definition: frame.h:57
Describes the stream itself, in particular the compression used, current packetDescriptors,...
Definition: stream.h:92
DAS_API PktDesc * DasStream_createPktDesc(DasStream *pThis, DasEncoding *pXEncoder, das_units xUnits)
Creates a descriptor structure that for a stream packet type.
DAS_API PktDesc * DasStream_getPktDesc(const DasStream *pThis, int id)
Get the packet descriptor associated with an ID.
DAS_API DasErrCode DasStream_freeSubDesc(DasStream *pThis, int nPktId)
Free any resources associated with this PacketDescriptor, and release it's id number for use with a n...
DAS_API void del_DasStream(DasStream *pThis)
Delete a stream descriptor and all it's sub objects.
DAS_API int DasStream_getOffset(DasStream *pThis)
An I/O function that makes sense to use for either operation.
DAS_API DasStream * new_DasStream(void)
Creates a new blank StreamDesc.
DAS_API char * DasStream_info(const DasStream *pSd, char *sBuf, int nLen)
Print a short description of the stream to a string buffer, This is not a serialization,...
DAS_API DasDesc * DasStream_nextPktDesc(const DasStream *pThis, int *pPrevPktId)
Iterate over packet descriptiors.
DAS_API void DasStream_setMonotonic(DasStream *pThis, bool isMonotonic)
Indicates if the xtags on the stream are monotonic, in which case there might be optimal ways of proc...
DAS_API void DasStream_addStdProps(DasStream *pThis)
Adds metadata into the property set of the DasStream.
DAS_API DasErrCode DasStream_encode(DasStream *pThis, DasBuf *pBuf)
Encode a DasStream to an XML string.
const DasFrame * DasStream_getFrameById(const DasStream *pThis, ubyte id)
Get a frame pointer by it's id.
DAS_API PktDesc * DasStream_clonePktDescById(DasStream *pThis, const DasStream *pOther, int nPktId)
Deepcopy a PacketDescriptor from one stream to another.
DAS_API void DasStream_addCmdLineProp(DasStream *pThis, int argc, char *argv[])
Adds the command line into the property set of the DasStream.
DasDesc base
The base structure.
Definition: stream.h:94
DAS_API const DasFrame * DasStream_getFrameByName(const DasStream *pThis, const char *sFrame)
Get a frame pointer by it's name.
DAS_API DasErrCode DasStream_addPktDesc(DasStream *pThis, DasDesc *pDesc, int nPktId)
Attach a packet descriptor to this stream.
DAS_API DasFrame * DasStream_createFrame(DasStream *pThis, ubyte id, const char *sName, const char *sType)
Define a new vector direction frame for the stream.
DAS_API DasStream * DasStream_copy(const DasStream *pThis)
Creates a deep-copy of an existing DasStream object.
DAS_API const DasFrame * DasStream_getFrame(const DasStream *pThis, int idx)
Get a frame pointer by it's index.
DAS_API size_t DasStream_getNPktDesc(const DasStream *pThis)
Get the number of packet descriptors defined for this stream.
DAS_API PktDesc * DasStream_clonePktDesc(DasStream *pThis, const PktDesc *pd)
Make a deep copy of a PacketDescriptor on a new stream.
void * pUser
User data pointer.
Definition: stream.h:123
Holds information for a single packet type in a Das2 stream.
Definition: packet.h:138