mirror of
https://gitee.com/TarsCloud/TarsCpp.git
synced 2025-01-05 17:42:24 +08:00
Merge pull request #122 from westonli/master
在resetDefautlt函数中增加枚举值的初始化
This commit is contained in:
commit
69a330d361
@ -844,6 +844,19 @@ string Tars2Cpp::generateH(const StructPtr& pPtr, const string& namespaceId) con
|
||||
s << TAB << member[j]->getId() << " = " << member[j]->def() << ";" << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ //没有提供初始值才会走到这里,提供枚举类型初始化值
|
||||
EnumPtr ePtr = EnumPtr::dynamicCast(member[j]->getTypePtr());
|
||||
if (ePtr)
|
||||
{
|
||||
vector<TypeIdPtr>& eMember = ePtr->getAllMemberPtr();
|
||||
if (eMember.size() > 0)
|
||||
{
|
||||
string sid = ePtr->getSid();
|
||||
s << TAB << member[j]->getId() << " = " << sid.substr(0, sid.find_first_of("::")) << "::" << eMember[0]->getId() << ";" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DEL_TAB;
|
||||
|
@ -401,6 +401,8 @@ int TC_TCPClient::recv(char *sRecvBuffer, size_t &iRecvLen)
|
||||
{
|
||||
return iRet;
|
||||
}
|
||||
|
||||
_epoller->mod(_socket.getfd(), 0, EPOLLIN);
|
||||
|
||||
int iRetCode = _epoller->wait(_timeout);
|
||||
|
||||
@ -456,6 +458,8 @@ int TC_TCPClient::recvBySep(string &sRecvBuffer, const string &sSep)
|
||||
return iRet;
|
||||
}
|
||||
|
||||
_epoller->mod(_socket.getfd(), 0, EPOLLIN);
|
||||
|
||||
while(true)
|
||||
{
|
||||
int iRetCode = _epoller->wait(_timeout);
|
||||
@ -518,6 +522,8 @@ int TC_TCPClient::recvAll(string &sRecvBuffer)
|
||||
{
|
||||
return iRet;
|
||||
}
|
||||
|
||||
_epoller->mod(_socket.getfd(), 0, EPOLLIN);
|
||||
|
||||
while(true)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user