Hello,
The special situation with that architecture is that each instance is at the same time both client and server
You need 2 classes because as you said :
it uses #defines to fix the role to be either server or client.So you could imagine to have 2 namespaces, for example named :
- from_client_to_server
- from_server_to_client
Inside these 2 namespaces, you have exactly the same classes and you just inverse the
#define in the implementation of the class (
.cpp).
To do it automatically and without having to do the job twice (create 2 classes each time), you could imagine to use QxEntityEditor : using a script, I think it should be quite easy to generate the 2 namespaces quickly and without having to deal with 2 structures (copying the qxee project file, execute a UPDATE SQL query on it to change the namespace of all entities, then do another export)...
Please let me know if you want more details about how to do it with QxEntityEditor, or if you want to try to write yourself 2 classes in different namespace.