mirror of
https://github.com/tars-node/tars2node.git
synced 2024-03-22 13:10:56 +08:00
Merge pull request #7 from zouchengzhuo/master
add ping for client proxy
This commit is contained in:
commit
ea4e5f7109
|
@ -60,6 +60,7 @@ void CodeGenerator::createFile(const string &file, const bool bEntry)
|
||||||
|
|
||||||
if (_bClient)
|
if (_bClient)
|
||||||
{
|
{
|
||||||
|
addTarsPingForProxy(contexts[i]); // add tars_ping function for client proxy
|
||||||
if (_bTS)
|
if (_bTS)
|
||||||
{
|
{
|
||||||
if (!generateTSProxy(contexts[i])) return; // generate .ts for proxy classes
|
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 scan(const string & sFile, bool bNotPrefix);
|
||||||
|
|
||||||
|
void addTarsPingForProxy(const ContextPtr &cPtr);
|
||||||
|
|
||||||
string makeName();
|
string makeName();
|
||||||
|
|
||||||
string findName(const string & sNamespace, const string & sName, const bool &bBase = false);
|
string findName(const string & sNamespace, const string & sName, const bool &bBase = false);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user