oms_buffer_subpool_create()

Abstract

Creates a new subpool inside a specified pool.

Syntax

oms_buffer_subpool_create (buffer_pool, max_units, max_elements, insert_proc, pool_stats, pool_name, user_data_ptr, status_ptr)

Argument Type Description
buffer_pool OmsT_Buffer_Pool_Handle buffer pool in which the operation should take place
max_units double maximum number of units that can be held by this subpool
max_elements double maximum number of elements that can be held by this subpool
insert_proc OmsT_Buffer_Insertion_Criteria_Proc function invoked whenever a new element is added to a buffer of this subpool
pool_stats OmsT_Buffer_Stats * array of statistic handles
pool_name const char * name associated with the subpool for ODB tracing
user_data_ptr void * arbitrary user data associated with the subpool
status_ptr OmsT_Buffer_Create * indicator of the success or failure (with reason) of the creation of this new subpool

Return Type

OmsT_Buffer_Handle

Created pool object or OPC_NIL if the operation failed.

Details

The buffer maximum capacity is constrained using the max_units and max_elements arguments. These can be positive values (greater than 0), or one of the symbolic constants OmsC_Buffer_Infinite or OmsC_Buffer_Parent_Limit. If the latter is specified, the subpool will use its parent pool’s constraint. Otherwise, the specified value will indicate the subpool-specific constraint. The subpool constraints must be as strict or stricter than those of its parent or the creation operation will fail.

insert_proc is the function to be used to check any new element added to a buffer of the subpool. This can be OPC_NIL (indicating no function is to be invoked), oms_buffer_pool_criteria_proc (indicating that the function to be used is whatever was specified for the parent pool), or the address of a user-specified function. See oms_buffer_enqueue() or Element Insertion for information about the function’s API and use.

Each subpool can automatically update a set of statistics. The list of statistics to maintain is specified by passing in an array of OmsT_Buffer_Stats. Each entry indicates if the statistic is to be maintained and the corresponding stat handle. Specifying OPC_NIL for pool_stats indicates that no statistics should be maintained initially. For more details on these statistics, see Maintained Statistics.

An optional name can be associated with the subpool. This is useful only in the context of ODB for tracing operations on that subpool. Use OPC_NIL to indicate that no name is provided.

An arbitrary structure can be associated with the subpool. This structure is not used in any way by the oms_buffer package but can be used by your code as wanted.

If status_ptr is not OPC_NIL, an appropriate value will be filled in to describe the result of the operation. For more details on the possible creation return values, see Buffer and Pool Creation.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com