libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions
stream.h File Reference

Objects representing a Das2 Stream as a whole. More...

Detailed Description

Objects representing a Das2 Stream as a whole.

#include <stdbool.h>
#include <das2/packet.h>

Go to the source code of this file.

Data Structures

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

Functions

void del_StreamDesc (StreamDesc *pThis)
 Delete a stream descriptor and all it's sub objects. More...
 
size_t StreamDesc_getNPktDesc (const StreamDesc *pThis)
 Get the number of packet descriptors defined for this stream. More...
 
bool StreamDesc_isValidId (const StreamDesc *pThis, int nPktId)
 Check to see if an packet ID has been defined for the stream. More...
 
DasDescDas2Desc_decode (DasBuf *pBuf)
 Das2 Stream Descriptor Factory Function. More...
 

Function Documentation

void del_StreamDesc ( StreamDesc pThis)

Delete a stream descriptor and all it's sub objects.

Parameters
pThisThe stream descriptor to erase, the pointer should be set to NULL by the caller.
size_t StreamDesc_getNPktDesc ( const StreamDesc pThis)

Get the number of packet descriptors defined for this stream.

Warning
It is possible to have a non-contiguous set of Packet IDs. Unless the application insures by some mechanism that packet IDs are not skipped when calling functions like StreamDesc_addPktDesc() then the results of this function will not useful for iteration.
Parameters
pThisThe stream descriptor to query
Returns
Then number of packet descriptors attached to this stream descriptor. For better performance the caller should reused the return value as all possible packet ID's are tested to see home many are defined.
bool StreamDesc_isValidId ( const StreamDesc 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
DasDesc* Das2Desc_decode ( DasBuf pBuf)

Das2 Stream Descriptor Factory Function.

Returns
Either a StreamDesc or a PktDesc object depending on the data received, or NULL if the input could not be parsed.