本文整理汇总了C++中Timestamp::ToString方法的典型用法代码示例。如果您正苦于以下问题:C++ Timestamp::ToString方法的具体用法?C++ Timestamp::ToString怎么用?C++ Timestamp::ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timestamp
的用法示例。
在下文中一共展示了Timestamp::ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleEvent
void Channel::HandleEvent(const Timestamp& fire_time)
{
LOG_DEBUG << this << endl;
LOG_INFO << "event happend at:" << fire_time.ToString() << endl;
LOG_INFO << ReadyEventToString() << endl;
LOG_INFO << CareEventToString() << endl;
if (ready_events_ & (EPOLLIN | EPOLLHUP))
{
if (read_callback_)
{
read_callback_(fire_time);
}
}
if (ready_events_ & EPOLLOUT)
{
if (write_callback_)
{
write_callback_();
}
}
if (ready_events_ & EPOLLERR)
{
if (error_callback_)
{
error_callback_();
}
}
// 这里记得清0
ready_events_ = 0;
}
示例2: OnSuccess
void ReqGetNewMsgs::OnSuccess()
{
PXml p = m_xml.getChildNode(0);
Assert(SafeStrCmp(p.getName(), "now"));
timestamp = p.getText();
p = m_xml.getChildNode(1);
if (SafeStrCmp(p.getName(), "msgs"))
{
int numMsgs = p.nChildNode();
for (int i = 0; i < numMsgs; i++)
{
PXml msg = p.getChildNode(i);
int id = atoi(msg.getChildNode(0).getText());
int senderId = atoi(msg.getChildNode(1).getText());
timestamp = msg.getChildNode(2).getText();
Timestamp whenSent = atoi(timestamp.c_str());
std::string text = msg.getChildNode(3).getText();
text = DecodeMsg(text); ////Replace(text, "_", " "); // replace underscores with spaces -- TODO punctuation
int recipId = atoi(msg.getChildNode(4).getText());
std::cout << "GOT NEW MSG!! ID: " << id << " sender: " << senderId << " sent: " << whenSent.ToString() << " text: " << text << "\n";
TheMsgManager::Instance()->QueueMsg(MsgManager::Msg(id, text, senderId, recipId, whenSent));
}
}
else
{
ShowError("Unexpected format for msgs response");
}
}