Simutrace
3.2.2
Simulation Tracing Framework
|
Describes the handler functions for a dynamic stream. More...
#include <SimuTraceTypes.h>
Data Fields | |
DynamicStreamInitialize | initialize |
Pointer to stream initializer. This handler is optional and may be left NULL . | |
DynamicStreamFinalize | finalize |
Pointer to stream finalizer. This handler is optional and my be left NULL . | |
DynamicStreamOpen | open |
Pointer to stream open handler. This handler is optional and may be left NULL . | |
DynamicStreamClose | close |
Pointer to stream handle close handler. This handler is optional and may be left NULL . | |
DynamicStreamGetNextEntry | getNextEntry |
Pointer to entry delivery handler. This handler is mandatory. | |
void * | reserved [4] |
Reserved for future use. Leave NULL . | |
Related Functions | |
(Note that these are not member functions.) | |
typedef int(* | DynamicStreamInitialize) (const DynamicStreamDescriptor *descriptor, StreamId id, void **userData) |
Dynamic stream initializer. More... | |
typedef void(* | DynamicStreamFinalize) (StreamId id, void *userData) |
Dynamic stream finalizer. More... | |
typedef int(* | DynamicStreamOpen) (const DynamicStreamDescriptor *descriptor, StreamId id, QueryIndexType type, uint64_t value, StreamAccessFlags flags, void **userDataOut) |
Dynamic stream open handler. More... | |
typedef void(* | DynamicStreamClose) (StreamId id, void **userData) |
Dynamic stream handle close handler. More... | |
typedef int(* | DynamicStreamGetNextEntry) (void *userData, void **entryOut) |
Dynamic stream entry delivery handler. More... | |
Dynamic streams are operated by user-defined handlers. This descriptor should be filled with pointers to the various functions. These functions are called by Simutrace to, for example, dynamically create entries or perform setup and cleanup for the stream.
|
related |
This dynamic stream handler is responsible for the initialization of any user implementation specific data and dependencies for the dynamic stream. This handler is called once when the stream is registered.
descriptor | The descriptor handed to Simutrace for stream registration. |
id | The id of the new dynamic stream. |
userData | Pointer to the DynamicStreamDescriptor::userData field. The handler may change the user-defined per-stream data by setting a new value with this parameter. |
|
related |
This dynamic stream handler is responsible for cleaning up any user-defined data that has been allocated for the stream. The handler is called once, when the stream is destroyed (e.g., when the store closes).
id | The id of the dynamic stream that is closed. |
userData | Pointer to the user-defined stream data. This is the DynamicStreamDescriptor::userData field. The handler should free any resources associated with the user data. |
|
related |
This dynamic stream handler is responsible for performing any operations that are necessary to get data from the stream later. The handler is invoked in the context of a call to StStreamOpen(). The handler may initialize user-defined data that will be local to the stream handle that is created during the open operation.
The dynamic stream should adhere to the semantic of the type
, value
, and flags
parameters as defined for regular streams. If a combination of flags is not supported, an error should be returned.
descriptor | The descriptor of the stream for which the handle is to be created. |
id | The id of the dynamic stream. |
type | Type of property value. Contains the value passed to StStreamOpen(). |
value | A value used in the query. Contains the value passed to StStreamOpen(). |
flags | Supplies information on how the caller intends to access the stream. Contains the value passed to StStreamOpen(). |
userDataOut | A dynamic stream handle can reference arbitrarily user-defined data, which will be available in all handlers that operate on the handle (e.g., DynamicStreamGetNextEntry). The parameter receives a pointer to the data and may be left NULL if not required. If the dynamic stream uses per-handle user-defined data, the data must only be released in DynamicStreamOperations::close. |
|
related |
Whenever an open stream handle is closed, this close handler is called to provide a chance for cleaning up user-defined data.
id | Id of the stream that is closed. |
userData | Pointer to the user data of the handle. Handle local data should be released in this function and the variable pointer to by userData should be set to NULL . |
|
related |
Entries in dynamic streams are generated or received from other streams dynamically. Simutrace accomplishes this by calling this handler method every time StGetNextEntry() is invoked on the stream.
userData | Pointer to any user-defined data supplied by the open handler DynamicStreamOperations::open. |
entryOut | Pointer that should be set to the location of the entry to be returned. The entry must be of the type and size specified in the stream descriptor for the dynamic stream. The returned value may be NULL , to indicate the end of the stream. It must be NULL if an error is returned. |
entryOut
to NULL
.