libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
StreamHandler Interface Reference

#include <das2/processor.h>

Inheritance diagram for StreamHandler:
Builder

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. More...
 
StreamHandlernew_StreamHandler (void *pUserData)
 Create a new stream processor with default callbacks. More...
 

Data Fields

StreamDescHandler streamDescHandler
 The function to be called when the stream header is read in. More...
 
PktDescHandler pktDescHandler
 Sets the function to be called when each <packet></packet> element is read in.
 
PktRedefHandler pktRedefHandler
 Sets the function to be called when a packet ID is about to be re-defined before the old pkt descriptor object is deleted.
 
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. More...
 
CommentHandler commentHandler
 StreamCommentHandler receives stream annotations. More...
 
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. More...
 

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
pThisThe stream handler structure to initialize
pUserDataA pointer that will be passed in to each callback, used to provide access to whatever state data you may need to reference.
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
pUserDataThe user data pointer will be set to this value.
Returns
A new StreamHandler allocated on the heap

Field Documentation

StreamDescHandler streamDescHandler

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.

ExceptionHandler exceptionHandler

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.

CommentHandler commentHandler

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.

void* userData

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: