Re: Generating a wrapper class from a typedef/template

"[email protected]" <[email protected]> Fri, 31 Dec 2021 17:29:09 +0000
Newsgroups gmane.comp.programming.swig
Message-ID <[email protected]>

> On 31. Dec 2021, at 16.50, [email protected] wrote:
> 
> 
> Hi,
> 
> I'm stuck here for hours:
> 
> I have 
> 
> typedef NCollection_List<TopoDS_Shape> TopTools_ListOfShape;
> 
> 
> which is used in calls to like following:
> 
>  Standard_EXPORT BRepOffsetAPI_MakeThickSolid(const TopoDS_Shape& S,
>                                               const TopTools_ListOfShape& ClosingFaces,
>                                               const Standard_Real Offset,
>                                               const Standard_Real Tol,
>                                               const BRepOffset_Mode Mode = BRepOffset_Skin,
>                                               const Standard_Boolean Intersection = Standard_False,
>                                               const Standard_Boolean SelfInter = Standard_False,
>                                               const GeomAbs_JoinType Join = GeomAbs_Arc,
>                                               const Standard_Boolean RemoveIntEdges = Standard_False);
> 
> SWIG genererates SWIGTYPE_p_NCollection_ListT_TopoDS_Shape_t and I can't seem figure out how to
> induce it to generate a proper wrapper class with all the methods that NCollection_List has.
> 
> wbr Kusti
> 


Finally the penny dropped when I considered that this is a template with nothing to call unless instantiated,
and hence from SWIG documentation the answer emerged:

%include "NCollection_List.hxx"
%include "TopTools_ListOfShape.hxx"
%template(TopTools_ListOfShape) NCollection_List<TopoDS_Shape>;

Sorry about the noise.

wbr Kusti