oms_buffer_flush()
摘要
遍历缓冲区中的元素,并移除 flush 过程返回 true 的每一个元素。
语法
oms_buffer_flush (buffer_handle, flush_proc, user_data_ptr)
| 参数 | 类型 | 说明 |
|---|---|---|
buffer_handle |
OmsT_Buffer_Handle |
要清空(flush)的缓冲区对象 |
flush_proc |
OmsT_Buffer_Element_Flush_Proc |
用于判断元素是否应被销毁的函数 |
user_data_ptr |
void * |
传递给 flush_proc 的用户数据 |
返回类型
无。
详细说明
该函数遍历缓冲区中的元素,对每个元素调用 flush_proc。flush_proc 应返回一个 Boolean 值,指示指定元素是否要被销毁。如果 flush_proc 返回 OPC_TRUE,oms_buffer_flush() 会将该元素从缓冲区中移除,并使用创建缓冲区时指定的销毁过程将其销毁;创建缓冲区由 oms_buffer_pool_create() 或 oms_buffer_pk_pool_create() 完成。
flush_proc 的原型如下:
Boolean *OmsT_Buffer_Element_Flush_Proc (
void *element,
double insertion_time,
void *user_data_ptr);