StreamHandler Interface Reference

#include <das2/processor.h>


Detailed Description

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

Public Member Functions

void StreamHandler_init (StreamHandler *pThis, void *pUserData)
 Initialize a stream processor with default callbacks.
StreamHandlernew_StreamHandler (void *pUserData)
 Create a new stream processor with default callbacks.

Data Fields

StreamDescHandler streamDescHandler
 The function to be called when the stream header is read in.
PktDescHandler pktDescHandler
 Sets the function to be called when each <packet></packet> element is read in.
PktDataHandler pktDataHandler
 Sets the function to be called when each data packet is read in.
ExceptionHandler exceptionHandler
 Sets the function to be called when a stream exception is read in.
CommentHandler commentHandler
 StreamCommentHandler receives stream annotations.
CloseHandler closeHandler
 Sets the function to be called the reading of the stream is completed.
void * userData
 An optional User-data pointer that is passed along to all callbacks.

Member Function Documentation

void StreamHandler_init ( StreamHandler pThis,
void *  pUserData 
)

Initialize a stream processor with default callbacks.

The library has builtin callbacks for the StreamExceptionHandler and the StreamCommentHandler. Calling this function will initialize a StreamHandler structure with the defaults and set all other callback pointers to NULL. The User Data pointer will also be NULL.

Parameters:
pSh The stream handler structure to initialize
StreamHandler * new_StreamHandler ( void *  pUserData  ) 

Create a new stream processor with default callbacks.

The library has builtin callbacks for the StreamExceptionHandler and the StreamCommentHandler. Calling this function will initialize a StreamHandler structure with the defaults and set all other callback pointers to NULL. The User Data pointer will also be NULL.

Parameters:
pUserData The user data pointer will be set to this value.
Returns:
A new StreamHandler allocated on the heap

Field Documentation

The function to be called when the stream header is read in.

This is the header with the element <stream></stream> in the input file.

Sets the function to be called when a stream exception is read in.

The default handler prints the exception and exits with a non-zero value.

StreamCommentHandler receives stream annotations.

These include progress messages, log files, informational messages, and other messages humans might be interested in. The default handler throws out the comment.

When handling Comments it is advisable to use Comment_isProgress() and DasIO_forwardProgress() to handle progress message This way progress messages do make it out, but are rate limited and thus don't swamp the output stream.

An optional User-data pointer that is passed along to all callbacks.

This value may be NULL.


The documentation for this interface was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 11 Sep 2016 for Das2 Stream Utilities by  doxygen 1.6.1