itaps-parallel technical issues in iMeshP.h
Jason Kraftcheck
kraftche at cae.wisc.edu
Tue Oct 7 09:59:43 CDT 2008
txie at scorec.rpi.edu wrote:
> I agree that the argument definition in iMeshP.h should be consistent in
> one way. And I think that the current argument definition trend in
> iMeshP.h can be summarized as follows. (I agree with it. )
>
> ----------------------------------------
> If an argument is an 'in' argument (it will not be changed through the
> function), it is a value not a pointer (except it is an 'array'
> argument).
And should be a const pointer in the case of an array.
>
> If an argument is an 'inout' or 'out' argument (it can be changed through
> the function), it is a pointer.
> -----------------------------------------
>
> Through this way, User may be more clear about the interface function usage.
>
> For example, in iMeshP.h, we have:
>
> iMeshP_createPart()
> iMeshP_destroyPart()
> iMeshP_createPartitionAll()
> iMeshP_destroyPartitionAll()
> iMeshP_syncPartitionAll()
>
> Since the 'part_handle/partition_handle' argument is changed through the
> function, it should be a pointer in the function argument list. (However,
> the 'partition_handle' argument in iMeshP_syncPartitionAll() is not a
> pointer now. )
>
The part_handle/partition_handle argument is *not* changed in:
iMeshP_destroyPart
iMeshP_syncPartitionAll
and perhaps
iMeshP_destroyPartitionAll
The entity that the handle references is changed, not the handle. The
purpose of passing a pointer to an argument is to allow the called function
to change the value of that argument. The functions are not changing the
handle value, and therefore should not be declared as if they were.
>
> PS:
> One minor thing, in the latest iMeshP.h version,
>
> void iMeshP_getCopyOnPart(iMesh_Instance instance,
> /*in*/ const iMeshP_PartitionHandle partition_handle,
> /*in*/ const iBase_EntityHandle entity_handle,
> /*in*/ const iMeshP_Part* part_id,
> /*out*/ iBase_EntityHandle* copy_entity_handle,
> int *err);
>
> To get one copy on a certain part, I think the 'in' argument 'part_id'
> should not be a pointer.
>
I agree with this.
- jason
More information about the itaps-parallel
mailing list