MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / generateStub

Method generateStub

src/stubgenerator/server/cppserverstubgenerator.cpp:51–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 : StubGenerator(stubname, procedures, filename) {}
50
51void CPPServerStubGenerator::generateStub() {
52 vector<string> classname = CPPHelper::splitPackages(this->stubname);
53 CPPHelper::prolog(*this, this->stubname);
54
55 this->writeLine("#include <jsonrpccpp/server.h>");
56 this->writeNewLine();
57
58 int depth = CPPHelper::namespaceOpen(*this, stubname);
59
60 this->writeLine(replaceAll(TEMPLATE_CPPSERVER_SIGCLASS, "<stubname>", classname.at(classname.size() - 1)));
61 this->writeLine("{");
62 this->increaseIndentation();
63 this->writeLine("public:");
64 this->increaseIndentation();
65
66 this->writeLine(replaceAll(TEMPLATE_CPPSERVER_SIGCONSTRUCTOR, "<stubname>", classname.at(classname.size() - 1)));
67 this->writeLine("{");
68 this->generateBindings();
69 this->writeLine("}");
70
71 this->writeNewLine();
72
73 this->generateProcedureDefinitions();
74
75 this->generateAbstractDefinitions();
76
77 this->decreaseIndentation();
78 this->decreaseIndentation();
79 this->writeLine("};");
80 this->writeNewLine();
81
82 CPPHelper::namespaceClose(*this, depth);
83 CPPHelper::epilog(*this, this->stubname);
84}
85
86void CPPServerStubGenerator::generateBindings() {
87 string tmp;

Callers

nothing calls this directly

Calls 8

generateBindingsMethod · 0.95
writeLineMethod · 0.80
writeNewLineMethod · 0.80
sizeMethod · 0.80
increaseIndentationMethod · 0.80
decreaseIndentationMethod · 0.80

Tested by

no test coverage detected