← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Added support for shared_ptr in the swig interface. Not used for now. Can be enabled by an #IFDEF.

 

On Tuesday 25 November 2008 01:05:18 Garth N. Wells wrote:
> DOLFIN wrote:
> > One or more new changesets pushed to the primary dolfin repository.
> > A short summary of the last three changesets is included below.
> >
> > changeset:   5197:293087f46b048ea16f9f00997b519f3d44e3be43
> > tag:         tip
> > user:        "Johan Hake <hake@xxxxxxxxx>"
> > date:        Tue Nov 25 00:17:44 2008 +0100
> > files:       dolfin/swig/dolfin.i dolfin/swig/dolfin_shared_ptr_classes.i
> > description:
> > Added support for shared_ptr in the swig interface. Not used for now. Can
> > be enabled by an #IFDEF.
> >
> >
> > changeset:   5196:0b29d25e8c0d8d839cc9ccce001d3f15c29f8b6d
> > user:        "Johan Hake <hake@xxxxxxxxx>"
> > date:        Tue Nov 25 00:14:25 2008 +0100
> > files:       dolfin/fem/Form.cpp dolfin/fem/Form.h
> > description:
> > Added another constructor to dolfin::Form. This is for the python
> > interface. Commenting out the delete _ufc_form in the destructor. Should
> > use shared_ptr in the future.
>
> Can we use const pointers in the std::vector, e.g.
>
>    const std::vector<const FunctionSpace*>&
>
> in place of
>
>    const std::vector<FunctionSpace*>&

It turned out that we couldn't... 

At least I couldn't get the swig interface to work with it. I tried to 
instantiate the swig templates using:

  %template(STLVectorFunctionPtr) std::vector<const dolfin::Function *>;
  %template(STLVectorFunctionSpacePtr) std::vector<const dolfin::FunctionSpace 
*>;

and swig did not like it. 

I do not know of any fix for this. Anyone?

I guess we for now have to live with the const_cast.

Johan

> ?
>
> Garth
>
> > changeset:   5195:75641326948e0e4163d275cb08ff5cce47a60c76
> > user:        "Garth N. Wells <gnw20@xxxxxxxxx>"
> > date:        Mon Nov 24 22:44:04 2008 +0000
> > files:       dolfin/fem/Form.cpp dolfin/fem/Form.h
> > description:
> > Add new constructor to Form.
> >
> > ----------------------------------------------------------------------
> > For more details, visit http://www.fenics.org/hg/dolfin
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev




References