Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to support templated base classes #7

Open
peremato opened this issue Jan 27, 2023 · 2 comments
Open

Need to support templated base classes #7

peremato opened this issue Jan 27, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@peremato
Copy link
Contributor

I encountered two cases of a class inheriting from a templated base class that is blocking the progress in Geant4.jl.

  • Class G4[U]Box inherits from G4UAdapter<vecgeom::UnplacedBox> and this one inherits from public G4VSolid, protected UnplacedVolume_t. It is needed that we can use instances of G4Box in function arguments expecting G4VSolid*.
  • Class HepGeom::Point3D<double> does not wrap any constructor. I get the following error:
    [ Info: Precompiling Geant4 [559df036-b7a0-42fd-85df-7d5dd9d70f44]
    C++ exception while wrapping module Geant4: No appropriate factory for type N7HepGeom7Point3DIdEE
    ERROR: LoadError: No appropriate factory for type N7HepGeom7Point3DIdEE
    
    The class is defined as template<class T> class Point3D : public BasicVector3D<T> {};

To reproduce the last error the following config file will do it:

include_dirs        = [ "/cvmfs/sft.cern.ch/lcg/views/LCG_102/x86_64-centos7-gcc11-opt/include" ]

input               = [ "CLHEP/Geometry/Transform3D.h",
                        "CLHEP/Geometry/Point3D.h",
                      ]
@grasph
Copy link
Owner

grasph commented Feb 1, 2023

Hello Pere,

I was not able to reproduce the issue with HepGeom::Point3D<double>. I will add the support for inheritance from templated class.

Philippe.

@grasph grasph added the enhancement New feature or request label Mar 11, 2023
@xgdgsc
Copy link

xgdgsc commented Jul 29, 2023

I' ve used https://gitlab.kitware.com/autopybind11/autopybind11 to generate some template based code. Would it be easier to reuse some code from there to generate for julia instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants