I have this sort of working now, but I have run into an additional
problem. Because of the way the mixins work (I assume the templated
base class), py++ is not figuring out that this class has a base class.
Because of this I am not getting the standard support for using the
methods of the base class that I have exposed.
Is there anyway to manually tell py++ about a class's base classes? For
example given a class decl could I manually tell it that it is derived
from class "Base" somehow so this would influence the code creators and
thus the generated code?
-Allen
Allen Bierbaum wrote:
> I am having trouble wrapping a class right now. The problem is that
> the class uses template base classes to mixin functionality. This
> makes it appear to pygccxml that the class has a half-dozen base
> classes. But I don't want to expose these base classes, all I want to
> expose is the class that is composed from the mixin functionality. To
> make matters worse there is something in the handling of these mixins
> that is making pyplusplus code creators expose them all as having the
> same name ("Inherited"). I think this is because each mixin class
> uses a typedef called Inherited to keep track of the class that it is
> inheriting from. (I have attached a file that shows the basic idea,
> but it is a vast simplification of the case I am really trying to handle)
>
> Anyway, to make a long story short, what I would like to do is just
> tell pyplusplus to ignore the base classes (ie. don't expose them) but
> to instead pull all of the methods defined in those base classes into
> the derived class I am trying to expose. Then the generated code
> would only create a wrapper for the derived class and would just
> create "def"'s that reference the methods from the mixins.
> Is this possible?
>
> -Allen
>
>------------------------------------------------------------------------
>
>
>namespace test_ns
>{
>template <class ParentT>
>class MethodAMixin : public ParentT
>{
>public:
> void methodA();
>};
>
>template <class ParentT>
>class MethodBMixin : public ParentT
>{
>public:
> void methodB();
>};
>
>template <class ParentT>
>class MethodCMixin : public ParentT
>{
>public:
> void methodC();
>};
>
>class Base
>{
>public:
> void methodBase();
>};
>
>typedef MethodAMixin< MethodBMixin< MethodCMixin< Base > > > ParentType;
>
>
>class MyClass : public ParentType
>{
>public:
> MyClass();
> bool getSomething();
>};
>
>
>} // namespace test_ns
>
>
>------------------------------------------------------------------------
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
>------------------------------------------------------------------------
>
>_______________________________________________
>pygccxml-development mailing list
>pyg...@li...
>https://lists.sourceforge.net/lists/listinfo/pygccxml-development
>
>
|