Closed EricCousineau-TRI closed 4 years ago
From current CastXML source, seems like it doesn't emit the generic template info at present? https://github.com/CastXML/CastXML/blob/8625aed52c8e2e0b94cfd65767a7564a36ce4c96/test/input/Class-template.cxx https://github.com/CastXML/CastXML/blob/8625aed52c8e2e0b94cfd65767a7564a36ce4c96/test/expect/castxml1.any.Class-template.xml.txt
Filed upstream issue: https://github.com/CastXML/CastXML/issues/171
As discussed in https://github.com/CastXML/CastXML/issues/171, we do not provide this right now. I'll close this issue, as the first step would be to add this capability to castxml. Once this is done, we can think about how to add it to pygccxml.
TL;DR
What's necessary to extend
pygccxml
to recognize template classes / functions? Does CastXML already recognize them, and is just a matter of parsing API?Background
In https://github.com/RobotLocomotion/drake/pull/13671 (issue https://github.com/RobotLocomotion/drake/pull/13670), I'm spike testing replacing our usage of
libclang
withpygccxml
.This is my way of spike-testing the ability of
pygccxml
to either bootstrap our current bindings in Drake, or completely automate them, and minimize the amount of enumeration needed (https://github.com/RobotLocomotion/drake/issues/7889)With
libclang
, we were able to letlibclang
discover template declarations for us. As an example, sample input file: https://github.com/RobotLocomotion/drake/blob/0d219dbc2642ce6f9c8120cb5839ac87a5bc637d/tools/workspace/pybind11/test/sample_header.h#L201-L238 Sample output ofmkdoc.py
: https://github.com/RobotLocomotion/drake/blob/0d219dbc2642ce6f9c8120cb5839ac87a5bc637d/tools/workspace/pybind11/test/sample_header_documentation.expected.h#L261-L277However, for our use case, we really want the generic template declaration information, not inf
With pygccxml
In this case, it's clear that we don't get the documentation for the specialization. From this comment: https://github.com/RobotLocomotion/drake/pull/13671#issuecomment-657138688 We get this output: https://gist.github.com/EricCousineau-TRI/8da1ad7963fa58315db5852488e18922#file-drake_issue13670_pygccxml_mkdoc_output-txt-L805-L874
And of course, that's mentioned in the
pygccxml
docs: https://pygccxml.readthedocs.io/en/master/examples/templates/example.html\cc @jamiesnape @josephsnyder