generated service interfaces issue

45 views
Skip to first unread message

Pedro Mello

unread,
Nov 28, 2013, 3:14:21 PM11/28/13
to wsf-...@googlegroups.com
I have to add a export decl to the services' generated interfaces so I could use it as a dynamic library but when I do it, the codegen alerts me that the file don't contains a service interface anymore. Clearly the codegen looks for a code pattern that doesn't tolerate any word between "class" and the class name itself.

WARNING 28-11-2013 18:02:34.077 src\CppParser.cpp[2027] staff::codegen::CppParser::Process: No staff service interfaces found. Staff services must inherited from staff::IService.
Example:
----
#include <staff/common/IService.h>

  class Calc: public staff::IService
  {
  public:
    virtual int Add(int nA, int nB) = 0;
  };
----

What I need is something like that:

#include <staff/common/IService.h>

  class WS_EXPORT Calc: public staff::IService
  {
  public:
    virtual int Add(int nA, int nB) = 0;
  };

Any clues? Or should I create a new issue?

Dmitry Utkin

unread,
Nov 29, 2013, 3:52:32 AM11/29/13
to wsf-...@googlegroups.com
You want to have client in a shared library?

This could be a problem, because codegen does not support macro definitions and can't resolve what WS_EXPORT mean. 

Also it does not know how to re-declare symbol in generated code.

Not sure how to implement this now.


пятница, 29 ноября 2013 г., 0:14:21 UTC+4 пользователь Pedro Mello написал:

Pedro Mello

unread,
Nov 29, 2013, 6:33:22 AM11/29/13
to wsf-...@googlegroups.com
It could be a new parameter for codegen: a text to be appended to the class declarations who don't breaks the codegen parser when looks for interface declarations. Let the macro's definition to the user and resolution to the compiler... What do you think?

Dmitry Utkin

unread,
Nov 29, 2013, 6:41:27 AM11/29/13
to wsf-...@googlegroups.com
Yes, this is not a problem itself.

In this case user must define WS_EXPORT at compiler-level like that:

/D WS_EXPORT="__declspec(dllexport)"

Is this acceptable?

пятница, 29 ноября 2013 г., 15:33:22 UTC+4 пользователь Pedro Mello написал:

Pedro Mello

unread,
Nov 29, 2013, 6:48:19 AM11/29/13
to wsf-...@googlegroups.com
It would be perfect!

Dmitry Utkin

unread,
Nov 29, 2013, 7:15:44 AM11/29/13
to wsf-...@googlegroups.com
Ok, please create new issue. I will implement it in next few days.

пятница, 29 ноября 2013 г., 15:48:19 UTC+4 пользователь Pedro Mello написал:

Pedro Mello

unread,
Nov 29, 2013, 11:26:28 AM11/29/13
to wsf-...@googlegroups.com
issue created (224). thanks a lot

Pedro Mello

unread,
Dec 26, 2013, 6:40:26 AM12/26/13
to wsf-...@googlegroups.com
Already tried and worked like a charm! just a missing detail: the same macro should be in the generated proxy classes ;)

Dmitry Utkin

unread,
Dec 26, 2013, 7:15:27 AM12/26/13
to wsf-...@googlegroups.com
You're right, fixed in r818.

четверг, 26 декабря 2013 г., 15:40:26 UTC+4 пользователь Pedro Mello написал:
Reply all
Reply to author
Forward
0 new messages