mirror of
https://github.com/tars-node/tars2node.git
synced 2024-03-22 13:10:56 +08:00
add ping for client proxy
This commit is contained in:
parent
f5799d8369
commit
73c4045b1b
|
@ -60,6 +60,7 @@ void CodeGenerator::createFile(const string &file, const bool bEntry)
|
|||
|
||||
if (_bClient)
|
||||
{
|
||||
addTarsPingForProxy(contexts[i]); // add tars_ping function for client proxy
|
||||
if (_bTS)
|
||||
{
|
||||
if (!generateTSProxy(contexts[i])) return; // generate .ts for proxy classes
|
||||
|
@ -107,3 +108,16 @@ void CodeGenerator::createFile(const string &file, const bool bEntry)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CodeGenerator::addTarsPingForProxy(const ContextPtr &cPtr){
|
||||
vector<NamespacePtr> namespaces = cPtr->getNamespaces();
|
||||
string ping = TC_Common::lower(IDL_NAMESPACE_STR) + "_ping";
|
||||
for(size_t i = 0; i < namespaces.size(); i++)
|
||||
{
|
||||
vector<InterfacePtr> & is = namespaces[i]->getAllInterfacePtr();
|
||||
for (size_t ii = 0; ii < is.size(); ii++)
|
||||
{
|
||||
is[ii]->createOperation(ping, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,6 +150,8 @@ private:
|
|||
|
||||
void scan(const string & sFile, bool bNotPrefix);
|
||||
|
||||
void addTarsPingForProxy(const ContextPtr &cPtr);
|
||||
|
||||
string makeName();
|
||||
|
||||
string findName(const string & sNamespace, const string & sName, const bool &bBase = false);
|
||||
|
|
Loading…
Reference in New Issue
Block a user