本文整理汇总了C++中TEventBase::LowerBound方法的典型用法代码示例。如果您正苦于以下问题:C++ TEventBase::LowerBound方法的具体用法?C++ TEventBase::LowerBound怎么用?C++ TEventBase::LowerBound使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEventBase
的用法示例。
在下文中一共展示了TEventBase::LowerBound方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IterationInit
TDBTEventIterationHandle CEvents::IterationInit(TDBTEventIterFilter & Filter)
{
CBlockManager::ReadTransaction trans(m_BlockManager);
PEntityEventsRecord record = getEntityRecord(Filter.hEntity);
if (!record)
return DBT_INVALIDPARAM;
std::queue<TEventBase * > q;
q.push(record->RealTree);
q.push(record->VirtualTree);
TDBTEntityIterFilter f = {0,0,0,0};
f.cbSize = sizeof(f);
f.Options = Filter.Options;
TDBTEntityIterationHandle citer = m_Entities.IterationInit(f, Filter.hEntity);
if (citer != DBT_INVALIDPARAM)
{
m_Entities.IterationNext(citer);
TDBTEntityHandle c = m_Entities.IterationNext(citer);
while (c != 0)
{
record = getEntityRecord(c);
if (record)
{
q.push(record->RealTree);
q.push(record->VirtualTree);
}
c = m_Entities.IterationNext(citer);
}
m_Entities.IterationClose(citer);
}
for (unsigned j = 0; j < Filter.ExtraCount; ++j)
{
record = getEntityRecord(Filter.ExtraEntities[j]);
if (record)
{
q.push(record->RealTree);
q.push(record->VirtualTree);
}
}
PEventIteration iter = new TEventIteration;
iter->Filter = Filter;
iter->LastEvent = 0;
iter->Heap = NULL;
TEventKey key;
key.TimeStamp = Filter.tSince;
key.Event = 0;
while (!q.empty())
{
TEventBase * b = q.front();
q.pop();
TEventBase::iterator it = b->LowerBound(key);
if (it)
{
TEventBase::iterator * it2 = new TEventBase::iterator(it);
it2->setManaged();
if (iter->Heap)
{
iter->Heap->Insert(*it2);
} else {
iter->Heap = new TEventsHeap(*it2, TEventsHeap::ITForward, true);
}
}
}
if (iter->Heap == NULL)
{
delete iter;
iter = (PEventIteration)DBT_INVALIDPARAM;
}
return reinterpret_cast<TDBTEventIterationHandle>(iter);
}