Closed FujiZ closed 2 months ago
Ref #8
And do we need to provide a generic CQ builder? Like provide a create_ex
boolean to let user decide whether normal ibv_cq
or ibv_cq_ex
should be created, thus we can use a single API for both situations. Though the problem is that some of the attributes in the cq_init_attr
would be ignored when use ibv_create_cq
, as it doesn't support them.
And do we need to provide a generic CQ builder? Like provide a
create_ex
boolean to let user decide whether normalibv_cq
oribv_cq_ex
should be created, thus we can use a single API for both situations. Though the problem is that some of the attributes in thecq_init_attr
would be ignored when useibv_create_cq
, as it doesn't support them.
I think a generic CQ builder is a good idea, but it seems impossible to let the user choose the concrete type of CQ by specifing a boolean parameter, since cq and cq_ex will be wrapped by different struct, and we are not able to return different types from a single build
method. Maybe using different method for creating cq and cq_ex (e.g. build
and build_ex
will be more viable.
BTW, I think it would be helpful to introduce a trait for CQ so that we can use the trait to create other resources (e.g. QP) rather than specifing a concrete type of cq or cq_ex.
A draft about using builder pattern to create cq