Hi Eskil,
thank you very much for your suggestions, that's a good starting 
point to manage this issue.
Anyway i would ask you how to handle this simpler 
subcase ( i refer to the code i posted first):
suppose that the class 
ContacsManager derived from the singletontemplate class is instantiated
in a 
dll (of course wrapped with all the stuff produced by generator) , how could i 
have the getInstance() method in java ? that is how could i access 
the 
contactsmanager instance from a java application ?

Thanks
Giorgio

>----
Messaggio originale----
>Da: [EMAIL PROTECTED]
>Data: 11/12/2008 9.17
>A: 
"[EMAIL PROTECTED]"<[EMAIL PROTECTED]>
>Cc: <[email protected]>

>Ogg: Re: [Qt-jambi-interest] class template &amp;&amp; multiple inheritance
>

>[EMAIL PROTECTED] wrote:
>> Thanks for the answer Eskil, 
>> but i wish 
templates will be supported soon....
>>   
>
>Templates as a general concept is 
impossible to support in the bindings, 
>since it's a static mechanism which 
relies on partially defining a class 
>and instantiating it heterogeneously. We 
do, however, support mapping 
>template instantiations as long as they are used 
as the only super class 
>in any inheritance relationship.
>
>To map the 
generic API from templates to Java's generic classes, you 
>would create a 
template instantiation with Qt Jambi's JObjectWrapper 
>type, which is a 
special type that maps to java.lang.Object, but handles 
>reference counting of 
the object on the JNI side to avoid accidental 
>garbage collection.
>
>As an 
example, it would work something like the following:
>
>template <typename T>

>class TemplateClass
>{
>public:
>    T getTemplateTypeObject();
>};
>
>typedef 
TemplateClass<JObjectWrapper> SpecializedTemplateClass;
>
>and then in the type 
system:
><object-type name="TemplateClass" generate="no" />
><object-type name="
SpecializedTemplateClass" generic-class="yes" 
>java-name="TemplateClass" />
>

>Unless I've made some typos, this should give you the equivalent API in 
>Java 
as in C++, but with generic classes rather than templates. You can 
>see the 
mapping of e.g. QFuture as an example of how this is done in Qt 
>Jambi.
>
>As 
I said, this does not work for interfaces at the moment, but maybe 
>the 
mechanism will give you some ideas to how you best can map your API 
>despite 
the missing support.
>
>-- Eskil
>


_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to