interrogate ignores my classes

Hello,

I just want to know if there are any other options. I have C++ classes like this

class A : public TypedReferenceCount

class B : public A
class C : public A

A and B have PUBLISHED methods, C does not have any own methods marked as PUBLISHED (but some public methods, which I need on the C++ layer).

Interrogate now seems to ignore C, probably because there are no PUBLISHED methods. If I create an instance of C in C++ and return it to Python I get an instance of Python-wrapper-for-A. I would have expected an instance of Python-wrapper-for-C. The firles created by interrogate do not have any lines for class C, but for A and B.

I think there are two ways to make interrogate create a Python wraper for C:

(1) add a dummy PUBLISHED method to C. This smells.

(2) use “interrogate -promiscuous”. Accoring to the help interrogate then exports all public symbols, which is not exactly what I want to have. I like to distinguish between PUBLISHED and public methods.

Do you know about any other solutions?

enn0x

I found a third way:

(3) Add a dummy PUBLISHED member.This is still a hack but at least I don’t need to write a documentation for the dummy method in solution (1) wink

class B : public A {

PUBLISHED:
  bool _dummy;

public:
...
};

enn0x

The way we normally handle this situation is to mark the get_type() method of C as PUBLISHED. Since C inherits from TypedReferenceCount, it declares a get_type() method, right? And this method is published anyway, because it is published in TypedReferenceCount, so you might as well publish it in the definition for C.

Arguably still a hack, but a little less of a hack than declaring a member you don’t need. Ideally, interrogate would figure this out on its own, but this is kind of a rare situation, and we’ve never bothered to fix this minor detail.

David

Thank you very much. This is exactly what I was looking for :slight_smile:

enn0x