[aspectc-user] Generate client/server. Feasible ?

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Thu Mar 2 15:25:39 CET 2006


Hi Patrick,

although I've always wanted to support such client/server stub 
generation feature, it does not work, yet. The main problem is on the 
server side where a function call would have to be synthesized. 
Therefore, one would need a generic mechanism to construct calls to 
functions with arbitrary signatures. This is tricky...

- Olaf

Patrick Duflot wrote:
> Hi,
> 
> My goal is to generate client and server classes from an interface declaration. The client and the server use XML and windows socket to communicate with each other. Is it feasible with aspectC++ ? How ?
> 
> Let's say I have an interface IFoo
> 
> interface IFoo
> {
> public:
> virtual int Foo(int i, std::string s) = 0;
> };
> 
> I want to generate something like this :
> 
> #include "MyProtocol.h"
> 
> class CFooClient : public CMyProtocol
> {
> public:
> CFooClient() : CMyProtocol(true) {}
> int Foo(int i, std::string s)
> {
> SendMethod(CXMLMethod("Foo", CXMLParam("i", i), CXMLParam("s", s)));
> }
> };
> 
> class CFooServer : public CMyProtocol
> {
> public:
> CFooServer() : CMyProtocol(false) {}
> protected:
> int OnReceive(CXMLMethod method) {
> switch (method.GetLabel()) {
> case "Foo":
> return Foo(method.GetParam("i"), method.GetParam("s"));
> }
> return -1;
> }
> };
> 
> Any help would be really welcome
> 
> Patrick
> 
> Sexy Like Us : Tu veux savoir si tu as la cote ? http://www.sexy.lycos.fr
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user




More information about the aspectc-user mailing list