& externalName,
const string& className,
51:
CParent(externalName, className, namespaceName, dataType, comments)
64 " "<<className<<
"(void);\n";
76 return out<<
'~'<<className<<
"(void);\n" 82 stringhttpclient(
"CSoapHttpClient");
86codeClassName +=
"_Base";
88 code.HPPIncludes().insert(
"serial/soap/soap_client");
90 stringmethodPrefix =
code.GetMethodPrefix();
98methodPrefix, haveUserClass,
ctx.GetMethodPrefix());
103 if(
i->dataType->IsStdType() &&
i->externalName ==
"#location") {
109 "// constructor\n"<<
110methodPrefix<<codeClassName<<
"(void)\n";
112 " : "<< httpclient <<
"(\n";
119 code.WriteConstructionCode(methods);
126methodPrefix<<
"~"<<codeClassName<<
"(void)\n" 128 code.WriteDestructionCode(methods);
142list<CWsdlTypeStrings::TMembers::const_iterator>& container,
148 const string& name = (*mi)->GetName();
150 if(!
x_WsdlDataType(ii->dataType) && ii->externalName == name) {
151container.push_back(ii);
159 if(
i->ref &&
i->dataType) {
160 return dynamic_cast<const CNullDataType*
>(
i->dataType->Resolve()) != 0;
167 const string& methodPrefix,
bool,
168 const string&
)
const 170 stringncbiNamespace =
178 if(!
type&&
i->externalName !=
"#location") {
180 i->type->GeneratePointerTypeCode(
code);
183 i->type->GenerateTypeCode(
code);
197 stringsoapaction(
"");
198list<TMembers::const_iterator> headerinputs;
199list<TMembers::const_iterator> inputs;
200list<TMembers::const_iterator> headeroutputs;
201list<TMembers::const_iterator> outputs;
208 if(
st->IsStdType() &&
st->GetMemberName() ==
"#soapaction"&&
st->GetDataMember()) {
209soapaction =
st->GetDataMember()->GetDefault()->GetXmlString();
234 stringmethodRet(
"void");
235list<string> methodOut;
237 size_tout_total = headeroutputs.size() + outputs.size();
239 ITERATE( list<TMembers::const_iterator>,
out, headeroutputs) {
241 stringreg(
"RegisterObjectType(");
242reg += (*out)->type->GetCType(
code.GetNamespace());
243reg +=
"::GetTypeInfo);";
245 stringout_param = ncbiNamespace +
"CConstRef< "+
246(*out)->type->GetCType(
code.GetNamespace()) +
" >";
247 if(out_total == 1) {
248methodRet = out_param;
251methodOut.push_back(out_param);
254 ITERATE( list<TMembers::const_iterator>,
out, outputs) {
256 stringreg(
"RegisterObjectType(");
257reg += (*out)->type->GetCType(
code.GetNamespace());
258reg +=
"::GetTypeInfo);";
260 stringout_param = ncbiNamespace +
"CConstRef< "+
261(*out)->type->GetCType(
code.GetNamespace()) +
" >";
262 if(out_total == 1) {
263methodRet = out_param;
266methodOut.push_back(out_param);
270 stringseparator(
"\n ");
271 stringhpp_separator(
"\n ");
272 stringcomma_separator =
","+ separator;
273 stringcommahpp_separator =
","+ hpp_separator;
274 stringinout_separator =
","+ separator;
275 stringinouthpp_separator =
","+ hpp_separator;
276 if(methodOut.empty()) {
277inout_separator =
"";
278inouthpp_separator =
"";
282list<string> methodIn;
283list<string> methodInNull;
284 intin_counter=0, hin_counter=0;
285 ITERATE( list<TMembers::const_iterator>,
in, headerinputs) {
287 stringin_type((*in)->type->GetCType(
code.GetNamespace()));
290methodInNull.push_back(in_type +
" "+ in_name +
";");
291methodInNull.push_back(in_name +
".Set();");
293methodIn.push_back(
string(
"const ") + in_type +
"& "+ in_name);
296hin_counter = in_counter;
297 ITERATE( list<TMembers::const_iterator>,
in, inputs) {
299 stringin_type((*in)->type->GetCType(
code.GetNamespace()));
302methodInNull.push_back(in_type +
" "+ in_name +
";");
303methodInNull.push_back(in_name +
".Set();");
305methodIn.push_back(
string(
"const ") + in_type +
"& "+ in_name);
309ncbiNamespace +
"CConstRef< "+ ncbiNamespace +
"CSoapFault"+
" >* fault");
313 i->comments.PrintHPPMember(header);
315<< methodRet << separator <<
i->externalName <<
"(";
316header << hpp_separator
318<< inouthpp_separator
320<<
" = 0) const;\n";
325<< methodPrefix <<
i->externalName <<
"(";
331 if(!methodInNull.empty()) {
336<< ncbiNamespace <<
"CSoapMessage request, response;";
337 for(
intp=1; p <= in_counter; ++p) {
339<<
"request.AddObject( in"<< p
340<<
", "<< ncbiNamespace;
341 if(p <= hin_counter) {
342methods <<
"CSoapMessage::eMsgHeader";
344methods <<
"CSoapMessage::eMsgBody";
348methods << separator <<
"Invoke(response,request,fault";
349 if(!soapaction.empty()) {
350methods <<
","<<
"\""<< soapaction <<
"\"";
354 ITERATE( list<TMembers::const_iterator>,
out, headeroutputs) {
356methods << separator;
357 if(out_total == 1) {
358methods <<
"return ";
360methods <<
"out"<< out_counter <<
" = ";
363<< ncbiNamespace <<
"SOAP_GetKnownObject< " 364<< (*out)->type->GetCType(
code.GetNamespace())
365<<
" >(response, "<< ncbiNamespace <<
"CSoapMessage::eMsgHeader);";
367 ITERATE( list<TMembers::const_iterator>,
out, outputs) {
369methods << separator;
370 if(out_total == 1) {
371methods <<
"return ";
373methods <<
"out"<< out_counter <<
" = ";
376<< ncbiNamespace <<
"SOAP_GetKnownObject< " 377<< (*out)->type->GetCType(
code.GetNamespace())
378<<
" >(response, "<< ncbiNamespace <<
"CSoapMessage::eMsgBody);";
380methods <<
"\n}\n\n";
383 code.AddConstructionCode(*reg);
list< SMemberInfo > TMembers
bool HaveUserClass(void) const
const string & GetClassNameDT(void) const
const TMembers & GetMembers(void) const
list< AutoPtr< CDataMember > > TMembers
static const CNamespace KNCBINamespace
void BeginClassDeclaration(CClassContext &ctx) const
const string & GetNamespaceName(void) const
EType GetWsdlType(void) const
CWsdlTypeStrings(const string &externalName, const string &className, const string &namespaceName, const CDataType *dataType, const CComments &comments)
virtual void GenerateClassCode(CClassCode &code, CNcbiOstream &setters, const string &methodPrefix, bool haveUserClass, const string &classPrefix) const override
virtual void GenerateTypeCode(CClassContext &ctx) const override
iterator_bool insert(const value_type &val)
std::ofstream out("events_result.xml")
main entry point for tests
static const char location[]
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
std::istream & in(std::istream &in_, double &x_)
static SLJIT_INLINE sljit_ins st(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
static CNcbiOstream & DeclareDestructor(CNcbiOstream &out, const string className, bool virt)
static bool x_IsNullDataType(CWsdlTypeStrings::TMembers::const_iterator i)
static CNcbiOstream & DeclareConstructor(CNcbiOstream &out, const string className)
static void x_CollectMembers(list< CWsdlTypeStrings::TMembers::const_iterator > &container, const CWsdlDataType *memb_type, const CWsdlTypeStrings::TMembers &members)
static const CWsdlDataType * x_WsdlDataType(const CDataType *type)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4