本文整理汇总了C++中EventData::getEventUid方法的典型用法代码示例。如果您正苦于以下问题:C++ EventData::getEventUid方法的具体用法?C++ EventData::getEventUid怎么用?C++ EventData::getEventUid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventData
的用法示例。
在下文中一共展示了EventData::getEventUid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convertEventToXmlParameter
// conversion functions
void convertEventToXmlParameter(EventData const& eventdata, XmlParameter &xmlparameter)
{
xmlparameter.clear();
xmlparameter.getName() = "event_packet";
xmlparameter.getParameter("source").getAsString(true) = eventdata.getSource();
xmlparameter.getParameter("puid").getAsUid(true) = eventdata.getParentEventUid();
xmlparameter.getParameter("uid").getAsUid(true) = eventdata.getEventUid();
xmlparameter.getParameter("etype").getAsInt(true) = eventdata.getEventType();
xmlparameter.getParameter("dtype").getAsInt(true) = eventdata.getType();
double sec = eventdata.getEventDate();
if (sec <= 0)
xmlparameter.getParameter("etime").getAsDate(true) =-1;
else
xmlparameter.getParameter("etime").getAsDate(true) = sec * 1000.0;
if (eventdata.getType()==EventData::DT_Log) {
XmlParameter logParam;
CommonLog const& log = eventdata.getAsLog();
double sec = log.logDate_m;
if (sec <= 0)
logParam.getParameter("time").getAsDate(true) = -1;
else
logParam.getParameter("time").getAsDate(true) = sec * 1000.0;
logParam.getParameter("level").getAsInt(true) = log.logLevel_m;
logParam.getParameter("context").getAsString(true) = log.context_m;
logParam.getParameter("content").getAsString(true) = CppUtils::wrapToCDataTags(log.content_m);
logParam.getParameter("session").getAsString(true) = log.session_m;
logParam.getParameter("thread").getAsInt(true) = log.logThread_m;
xmlparameter.getXmlParameter("log") = logParam;
}
else if (eventdata.getType()==EventData::DT_CommonXml) {
xmlparameter.getXmlParameter("commonxml") = eventdata.getAsXmlParameter();
}
else if (eventdata.getType()==EventData::DT_String) {
xmlparameter.getParameter("str").getAsString(true) = eventdata.getAsString();
}
else if (eventdata.getType()==EventData::DT_StringList) {
xmlparameter.getParameter("strlist").getAsStringList(true) = eventdata.getAsStringList();
}
else if (eventdata.getType()==EventData::DT_StringMap) {
XmlParameter strMapParam;
CppUtils::StringMap const& strmap = eventdata.getAsStringMap();
for(CppUtils::StringMap::const_iterator it = strmap.begin(); it != strmap.end(); it++) {
strMapParam.getParameter(it->first).getAsString(true) = it->second;
}
xmlparameter.getXmlParameter("strmap") = strMapParam;
}
else if (eventdata.getType()==EventData::DT_Ticker) {
convertToXmlParameter(eventdata.getAsRtData(), xmlparameter.getXmlParameter("ticker"));
}
else if (eventdata.getType()==EventData::DT_TickerList) {
XmlParameter tickerParam;
RtDataList const& rtlist = eventdata.getAsRtDataList();
for(int i = 0; i < rtlist.size(); i++) {
convertToXmlParameter(rtlist[ i ], tickerParam);
xmlparameter.getXmlParameterList("tickerlist").push_back(tickerParam);
}
}
else if (eventdata.getType()==EventData::DT_Dummy) {
// no-op
}
else if (eventdata.getType()==EventData::DT_Level2Data) {
//convertLevel2ToXmlParameter(eventdata.getAsLevel2Data(), xmlparameter.getXmlParameter("level2data"));
HTASSERT(false);
}
else if (eventdata.getType()==EventData::DT_Level1Data) {
convertLevel1ToXmlParameter(eventdata.getAsLevel1Data(), xmlparameter.getXmlParameter("level1data"));
}
else if (eventdata.getType()==EventData::DT_DrawableObject) {
convertDrawableObjToXmlParameter(eventdata.getAsDrawableObject(), xmlparameter.getXmlParameter("drawobj"));
}
else {
// dummy
HTASSERT(false);
}
}