本文整理汇总了C++中BasePlugin::CheckCollection方法的典型用法代码示例。如果您正苦于以下问题:C++ BasePlugin::CheckCollection方法的具体用法?C++ BasePlugin::CheckCollection怎么用?C++ BasePlugin::CheckCollection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasePlugin
的用法示例。
在下文中一共展示了BasePlugin::CheckCollection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Run
void Run(TimeKeeper& timeKeeper)
{
// Warm up some threads
ThreadSynchronizer threads(m_numThreads);
// Allocate storage
Result result;
result.params.items = new ItemSet[m_numItems];
memset(result.params.items, 0, sizeof(ItemSet) * m_numItems);
result.params.numItems = m_numItems;
result.params.numThreads = m_numThreads;
result.plugin = m_plugin;
result.failed._nonatomic = 0;
// Fill in pairs
Random keySeq;
Random valueRandom;
for (uint32_t i = 0; i < m_numItems; i++)
{
do { result.params.items[i].key = keySeq.generateUnique32(); } while (result.params.items[i].key == 0);
for (int j = 0; j < m_numThreads; j++)
do { result.params.items[i].value[j] = valueRandom.generate32(); } while (result.params.items[i].value[j] == 0);
}
// Kick threads through the experiment several times
for (int i = 0; i < 10; i++)
{
m_plugin->CreateCollection(m_tableSize);
threads.run(threadFunc, &result.params);
// Check result
if (result.failed._nonatomic || !m_plugin->CheckCollection(&result.params))
timeKeeper.failures++;
// Return average thread time
timeKeeper.totalTime += threads.getAverageThreadRunningTime();
timeKeeper.trials++;
}
}