<div class="gmail_quote">On Thu, Mar 17, 2011 at 13:19, Lisandro Dalcin <span dir="ltr"><<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":1s0">Well, you have a very valid point, but as I said, PetscObjectXXX()<br>
calls are nasty to use and you loose type checking... What about<br>
providing XXSetup(), XXXGetComm(), XXXSetFromOptions(), and any other<br>
important enough as STATIC_INLINE functions being a thin wrapper to<br>
the corresponding PetscObjectXXX() ?</div></blockquote></div><br><div>It's a documentation problem as much as anything, technically these wrappers are one-liners to create (caps because it's a compile-time definition).</div>
<div><br></div><div>petscsys.h:</div><div><br></div><div>#define PETSC_OBJECT_FORWARD_DEFINE1(type,method,arg1type) \</div><div>  PETSC_STATIC_INLINE PetscErrorCode type ## method (type obj,arg1type arg1) { \</div><div>    PetscErrorCode ierr; \</div>
<div>    PetscFunctionBegin; \</div><div>    PetscValidHeaderSpecific(obj,type ## _CLASSID,1); \</div><div>    ierr = PetscObject ## method ((PetscObject)obj,arg1);CHKERRQ(ierr); \</div><div>    PetscFunctionReturn(0);</div>
<div>  }</div><div><br></div><div>petscdm.h:</div><div><br></div><div>PETSC_OBJECT_FORWARD_DEFINE1(DM,GetComm,MPI_Comm*)</div><div><br></div><div><br></div><div>I don't have a strong opinion about whether or not to have these wrappers.</div>