本文整理汇总了C++中CAtlString::AppendFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ CAtlString::AppendFormat方法的具体用法?C++ CAtlString::AppendFormat怎么用?C++ CAtlString::AppendFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAtlString
的用法示例。
在下文中一共展示了CAtlString::AppendFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetStatistics
CAtlString CSimulatorIn::GetStatistics()
{
unsigned int TotalNeighborCount = 0;
POSITION pos = PeerInfoMap->GetStartPosition();
while(pos != NULL)
{
TotalNeighborCount+= PeerInfoMap->GetValueAt(pos)->NeighborPeerIDMap.GetCount();
PeerInfoMap->GetNext(pos);
}
CAtlString String;
String.AppendFormat("RandomSeed : %u\r\n", InitRandomSeed);
String.AppendFormat("Max Flood Hop Count : %u\r\n", InitMaxFloodHopCount);
String.AppendFormat("CacheMode/GroupMode : %s/%s\r\n", CacheMode == MODE_CACHE_OFF ? "OFF" : "ON", GroupMode == MODE_GROUPING_OFF ? "OFF" : "ON");
String.AppendFormat("Total Peers : %u\r\n", PeerInfoMap->GetCount());
//String.AppendFormat("Total Contents : %u\r\n", ContentInfoMap->GetCount());
String.AppendFormat("Average Number of Contents per Peer : %g\r\n", (double)ContentInfoMap->GetCount() / PeerInfoMap->GetCount());
//String.AppendFormat("Total Neighbor Peers : %u\r\n", TotalNeighborCount);
String.AppendFormat("Average Number of Neighbor per Peer : %g\r\n", (double)TotalNeighborCount / PeerInfoMap->GetCount());
String.AppendFormat("Total Message Count (Traffic) : %u\r\n", StatisticsTotalMessageCount);
for(int i = 0;i < MESSAGE_KINDS;i++)
{
if(StatisticsTotalMessageCountEach[i] > 0)
String.AppendFormat("Total Message Count \"%s\" : %u\r\n", MesssageNames[i], StatisticsTotalMessageCountEach[i]);
}
String.AppendFormat("Total Search Content : %u\r\n", StatisticsTotalSearchContentCount);
String.AppendFormat("Total Search Content Success/Failure : %u / %u\r\n", StatisticsTotalSearchContentSuccessCount, StatisticsTotalSearchContentCount - StatisticsTotalSearchContentSuccessCount);
if(StatisticsTotalSearchContentSuccessCount > 0)
String.AppendFormat("Average Number of Hops per Search Content Success : %g\r\n", (double)StatisticsTotalSearchContentHopCount / StatisticsTotalSearchContentSuccessCount);
return String;
}