das2C
das core C utilities (v3)
Loading...
Searching...
No Matches
Data Structures | Typedefs | Functions
processor.h File Reference

Callback processing for das2 stream reads and writes. More...

#include <das3/stream.h>
#include <das3/oob.h>
Include dependency graph for processor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

interface  StreamHandler
 A set of callbacks used for input and output stream processing. More...
 

Typedefs

typedef DasErrCode(* DasStreamHandler) (DasStream *sd, void *ud)
 Definition of the callback function invoked when a stream header is encountered in the input.
 
typedef DasErrCode(* PktDescHandler) (DasStream *sd, PktDesc *pd, void *ud)
 Definition of the callback function invoked when a packet header is encountered in the input.
 
typedef DasErrCode(* PktRedefHandler) (DasStream *sd, DasDesc *pd, void *ud)
 Definition of the callback function invoked when a packet header is going to be deleted.
 
typedef DasErrCode(* PktDataHandler) (PktDesc *pd, void *ud)
 Callback function invoked when a data packet is encountered in the input.
 
typedef DasErrCode(* DsDescHandler) (DasStream *sd, int pi, DasDs *dd, void *ud)
 Callback function invoked when a dataset header is encountered on the input stream.
 
typedef DasErrCode(* DsDataHandler) (DasStream *sd, int pi, DasDs *dd, void *ud)
 Callback function invoked when a new data packets for a dataset are encountered on the stream.
 
typedef DasErrCode(* CloseHandler) (DasStream *sd, void *ud)
 Callback functions that are invoked on Stream Close callback function that is called at the end of the stream.
 
typedef DasErrCode(* ExceptionHandler) (OobExcept *se, void *ud)
 Callback functions that handle exceptions.
 
typedef DasErrCode(* CommentHandler) (OobComment *se, void *ud)
 Callback functions that handle comments.
 

Functions

DAS_API void del_StreamHandler (StreamHandler *pThis)
 Type safe wrapper around free()
 

Detailed Description

Callback processing for das2 stream reads and writes.

These structure allow one to hook in Das2 Stream object processing that is triggered when Headers and Data are read or written to a file.

Typedef Documentation

◆ DasStreamHandler

typedef DasErrCode(* DasStreamHandler) (DasStream *sd, void *ud)

Definition of the callback function invoked when a stream header is encountered in the input.

Parameters
sdA pointer to the parsed DasStream
pdA pointer to a user data structure, may be NULL.
See also
StreamHandler

◆ PktDescHandler

typedef DasErrCode(* PktDescHandler) (DasStream *sd, PktDesc *pd, void *ud)

Definition of the callback function invoked when a packet header is encountered in the input.

Parameters
sdA pointer to the parsed Stream Descriptor
pdA pointer to the parsed Packet Descriptor
udA pointer to a user data structure, may be NULL.
See also
StreamHandler

◆ PktRedefHandler

typedef DasErrCode(* PktRedefHandler) (DasStream *sd, DasDesc *pd, void *ud)

Definition of the callback function invoked when a packet header is going to be deleted.

This only occurs if streams re-define packet IDs

Parameters
sdA pointer to the parsed Stream Descriptor
pdThe descriptor about to be deleted. das2 streams keep a PktDesc in the ID slot, das3 streams a DasDs, so check DasDesc_type() before casting. Handlers that only want the signal can ignore it entirely.
udA pointer to a user data structure, may be NULL.
Returns
DAS_OKAY to let the redefinition proceed. Any other value refuses it: the old descriptor is left intact and the read stops with that code. Refuse if you were accumulating data that can't survive the descriptor going away.
See also
StreamHandler

◆ PktDataHandler

typedef DasErrCode(* PktDataHandler) (PktDesc *pd, void *ud)

Callback function invoked when a data packet is encountered in the input.

Parameters
sdA pointer to the parsed Packet Descriptor
udA pointer to a user data structure, may be NULL.
See also
StreamHandler

◆ DsDescHandler

typedef DasErrCode(* DsDescHandler) (DasStream *sd, int pi, DasDs *dd, void *ud)

Callback function invoked when a dataset header is encountered on the input stream.

Parameters
sdA pointer to the parsed Stream Descriptor
piThe packet ID associated with this dataset
ddA pointer to a parsed DasDs (dataset) definition
udA pointer to a user data structure, may be NULL

◆ DsDataHandler

typedef DasErrCode(* DsDataHandler) (DasStream *sd, int pi, DasDs *dd, void *ud)

Callback function invoked when a new data packets for a dataset are encountered on the stream.

Parameters
sdA pointer to the parsed Stream Descriptor
piThe packet ID associated with this dataset
ddA pointer to a parsed DasDs (dataset) definition
piA pointer to the max index of the dataset before the new data were added
udA pointer to a user data structure, may be NULL

◆ CloseHandler

typedef DasErrCode(* CloseHandler) (DasStream *sd, void *ud)

Callback functions that are invoked on Stream Close callback function that is called at the end of the stream.

Parameters
sdA pointer to the parsed Stream Descriptor
udA pointer to a user data structure, may be NULL.
See also
StreamHandler

◆ ExceptionHandler

typedef DasErrCode(* ExceptionHandler) (OobExcept *se, void *ud)

Callback functions that handle exceptions.

Parameters
seA pointer to the parsed Exception
udA pointer to a user data structure, may be NULL.
See also
StreamHandler

◆ CommentHandler

typedef DasErrCode(* CommentHandler) (OobComment *se, void *ud)

Callback functions that handle comments.

Parameters
seA pointer to the parsed Comment
udA pointer to a user data structure, may be NULL.
See also
StreamHandler