#include <dc_filterservice.h>
Public Methods | |
char* | getName (void) |
bool | isEndOfWork (void) |
bool | isEndOfStream (void) |
int | write (DC_Buffer_t *pbuf, void *pUserArg=NULL) |
int | write (DC_Buffer_t &buf, void *pUserArg=NULL) |
int | write_nocopy (DC_Buffer_t *pbuf, void *pUserArg=NULL) |
int | write_nocopy (DC_Buffer_t &buf, void *pUserArg=NULL) |
int | close (bool fEndOfWork=false) |
This is passed into filter objects for accessing the streams, and are local to each filter thread (other than the pointers to potentially shared (colocated) DC_Remote objects).
write() does a deep copy of the buffer object and memory region as needed to allow the caller to modify the buffer immediately after this call returns. For example, a colocated sink will cause the buffer object and memory region to be duplicated and placed directly in the consumer's queue.
pUserArg is used for when there is a user-defined stream write policy in use. This extra arg is passed to the policy.write_copyset() callback to help decide which copyset the buffer should be directed to. A typical example would be to more simply pass along metadata, such as spatial location information, along with a data chunk to avoid needing to decode the whole data buffer to decide where it should be sent.
write_nocopy() uses the given buffer. If colocated with the sink this will be deposited directly in that Queue. Use of stack allocated DC_Buffer_t objects for this call is not recommended due to undesirable results if the stack frame is removed before the object is dequeued/used by a colocated consumer.
pUserArg is used for when there is a user-defined stream write policy in use. This extra arg is passed to the policy.write_copyset() callback to help decide which copyset the buffer should be directed to. A typical example would be to more simply pass along metadata, such as spatial location information, along with a data chunk to avoid needing to decode the whole data buffer to decide where it should be sent.
|
Be VERY careful using this version with local vars on the stack, since it could be needed long after the write call if we are colocated with the consumer. |