-
Notifications
You must be signed in to change notification settings - Fork 52
Description
When trying to scan the bindings for a module (ns-3), I get an error with the tokens because it is None. Tracking down the error, I see the cast parser uses the partial declaration to normalize a name [normalize_name(alias.decl_type.partial_decl_string)]. However, the problem comes because the 'decl_string' and 'partial_decl_string' are different:
namespace ns3 {
struct GabA
{
uint32_t m_varU {0};
double m_varD {0.0};
};
struct GabD
{
uint32_t m_varU {0};
double m_varD {0.0};
};
typedef std::function<GabD & (const std::shared_ptr<GabA> &ga)> GabSharedFn;
typedef std::function<GabD & (const std::unique_ptr<GabA> &ga)> GabUniqueFn;
}
When the code is parsed, these are the decl_string and partial_decl_string for the two typedefs:
- GabSharedFn
partial_decl_string:'::std::function< ns3::GabD &(const std::shared_ptr< ns3::GabA > >'
decl_string:'::std::function<ns3::GabD &(const std::shared_ptr<ns3::GabA> &)>'
- GabUniqueFn
partial_decl_string:'::std::function< ns3::GabD &(const std::unique_ptr< ns3::GabA, std::default_delete< ns3::GabA > > >'
decl_string:'::std::function<ns3::GabD &(const std::unique_ptr<ns3::GabA, std::default_delete<ns3::GabA> > &)>'
As you can see, both partial declaration strings are missing &) and that is why I get the error. I had to hard-code this inside the typehandlers directory because I could not figure out where the classes are parsed (i.e., where partial_decl_string and decl_string are created). It seems to me that pygccxml takes care of that but I am not sure. Do you know where the partial_decl_string and decl_string are created?
I would appreciate your feedback.
Thanks!