das2C
das core C utilities (v3)
Data Structures | Macros | Functions
stream.h File Reference

Objects representing a single das stream. More...

#include <stdbool.h>
#include <das2/packet.h>
#include <das2/dataset.h>
Include dependency graph for stream.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DasStream
 Describes the stream itself, in particular the compression used, current packetDescriptors, etc. More...
 

Macros

#define StreamDesc   DasStream
 Compatability macro For backwards compatability, all functions with the name pattern DasStream are also have a macro alias to StreamDesc.
 

Functions

DAS_API int DasStream_nextFrameId (const DasStream *pThis)
 Get the next open frame ID. More...
 
DAS_API bool DasStream_isValidId (const DasStream *pThis, int nPktId)
 Check to see if an packet ID has been defined for the stream. More...
 
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. More...
 
DAS_API DasDescDasDesc_decode (DasBuf *pBuf, DasStream *pSd, int nPktId, int nModel)
 Packtized Stream Descriptor Factory Function. More...
 

Detailed Description

Objects representing a single das stream.

Function Documentation

◆ DasStream_nextFrameId()

DAS_API int DasStream_nextFrameId ( const DasStream pThis)

Get the next open frame ID.

Returns
then next valid frame ID or a negative DasErrCode if no more frames are allowed

◆ DasStream_isValidId()

DAS_API bool DasStream_isValidId ( const DasStream pThis,
int  nPktId 
)

Check to see if an packet ID has been defined for the stream.

Parameters
pThisThe stream to check
nPktIdThe ID in question
Returns
true if a packet of that type is defined on the stream false otherwise

◆ DasStream_getFrameId()

DAS_API int8_t DasStream_getFrameId ( const DasStream pThis,
const char *  sFrame 
)

Get a frame index given it's name.

Returns
negative DasErrCode if there's no frame for the given name

◆ DasDesc_decode()

DAS_API DasDesc* DasDesc_decode ( DasBuf pBuf,
DasStream pSd,
int  nPktId,
int  nModel 
)

Packtized Stream Descriptor Factory Function.

Parameters
pBufA buffer containing string data to decode.
pSd- The Stream descriptor, if it exists. May be NULL.
nPktId- The packet tag ID number corresponding to this top-level descriptor
nModel- The expected data model to parse into, one of STREAM_MODEL_MIXED, STREAM_MODEL_V2, or STREAM_MODEL_V3
Returns
Either a top level Descriptor object. The specific type dependings on the data received, or NULL if the input could not be parsed.