jeudi 5 mars 2015

Storing code in library/dll


I have some code which I would like to allow third parties to implement (but not have access to the code).


(I believe) this is straight forward enough for non-template classes (as I would just supply them with a set of header files for the definitions along with the dll containing the actual class/method implementations)... but how would that work with template classes?


Based on this article, I can seperate the code from the definitions (using Chris A's answer regarding .hxx files)... c++ template and header files


This means I can have a series of header files that contain only the definitions of my template classes, but... how do I put the implementations in a dll?


If I know what template parameters will be used, I am presuming I can get my dll to compile with the appropriate classes in it, somehow.


If I don't know what template parameters will be used, I am presuming I can't and therefore can't avoid giving access to the class implementations.


Can anyone please give me some input on how I should approach this?


I am using qt dynamic linked libraries.


Thanks!




Aucun commentaire:

Enregistrer un commentaire