本文整理汇总了C++中EventMessage::pushParam方法的典型用法代码示例。如果您正苦于以下问题:C++ EventMessage::pushParam方法的具体用法?C++ EventMessage::pushParam怎么用?C++ EventMessage::pushParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventMessage
的用法示例。
在下文中一共展示了EventMessage::pushParam方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendTo
void Client::SendTo(const std::string target, EventMessage &msg)
{
msg.setSender(this->name);
std::stringbuf msgBuffer;
msg.serialize(msgBuffer);
EventMessage targetPacket;
targetPacket.setEventType(DIRECTSEND_MSG);
targetPacket.pushParam(target);
targetPacket.pushParam(msgBuffer.str());
targetPacket.setSender(this->name);
this->Send(targetPacket, PRIORITY_COMMAND);
}
示例2: ClientsRegistered
size_t Client::ClientsRegistered(std::string eventType)
{
EventMessage msg;
msg.setEventType(REGISTERED_MSG);
msg.pushParam(eventType);
this->Send(msg, PRIORITY_COMMAND);
this->WaitForEvent(msg, REGISTERED_RESP);
return (size_t)msg.getParamInt(0);
}
示例3: IsClientConnected
bool Client::IsClientConnected(std::string target)
{
EventMessage msg;
msg.setEventType(ISCONNECTED_MSG);
msg.pushParam(target);
this->Send(msg, PRIORITY_COMMAND);
this->WaitForEvent(msg, ISCONNECTED_RESP);
return ( msg.getParamInt(0) != 0 );
}