Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I tell gSOAP to ignore certain declarations of types in a header file so I can write class methods that use parameters of these types?

0
Posted

How can I tell gSOAP to ignore certain declarations of types in a header file so I can write class methods that use parameters of these types?

0

You can provide the type declarations in the header file and use the ‘extern’ qualifier or enclose the type declarations between [ and ] to make them ‘transient’, i.e. non-serializable. For example: extern class ostream; // can’t be (de)serialized so must be declared a transient type class ns__foo { public: char *s; struct soap *soap; // special field: already transient ns__foo(); [ ns__foo(const char *t); // transient constructor print(ostream &s); // transient method ] }; with e.g. the following implementation of ns__foo: ns__foo::ns__foo(const char *t) { s = (char*)soap_malloc(soap, strlen(t)+1); strcpy(s, t); } The ‘struct soap* soap’ field in this class is a special field set by gSOAP’s deserializers and the gSOAP-generated soap_new_ns__foo() function.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123