void SkosCollection::addCollection(SkosCollection *p_collection) { if (findCollection(*p_collection) == m_memberCollections.end()) { m_memberCollections.append(p_collection); } else { qDebug() << "SkosCollection::addCollection() - collection already added"; } }
void SkosCollection::removeCollection(const SkosCollection &p_collection) { QList<SkosCollection*>::iterator l_collectionToRemove = findCollection(p_collection); if (l_collectionToRemove != m_memberCollections.end()) { m_memberCollections.erase(l_collectionToRemove); } else { qDebug() << "SkosCollection::removeCollection() - no such collection"; } }
void ProfileEventHandler::onStartEvent( const PxProfileEventId& inId, PxU32 threadId, PxU64 contextId, PxU8 cpuId, PxU8 threadPriority, PxU64 timestamp ) { EventCollection* threadCollection = findCollection(threadId); // add a new collection for this thread Id if it's not already there if(!threadCollection) { EventCollection ec; ec.cpuId = cpuId; ec.threadId = threadId; ec.threadPriority = threadPriority; mThreadCollections.pushBack(ec); threadCollection = &mThreadCollections.back(); threadCollection->events.reserve(EVENTS_RESERVE_SIZE); } // add the event record ProfileEvent ev = { inId, contextId, timestamp, ProfileEvent::INVALID_TIME }; threadCollection->events.pushBack(ev); }
void ProfileEventHandler::onStopEvent( const PxProfileEventId& inId, PxU32 threadId, PxU64 contextId, PxU8 cpuId, PxU8 threadPriority, PxU64 timestamp ) { PX_UNUSED(contextId); PX_UNUSED(cpuId); PX_UNUSED(threadPriority); EventCollection* threadCollection = findCollection(threadId); PX_ASSERT(threadCollection != NULL); // an event (e.g. narrow phase batch) can occur several times per thread per frame, so // we take the earliest event with a matching id that does not yet have a stop time const PxU32 eventsSize = threadCollection->events.size(); for (PxU32 i = 0; i < eventsSize; i++) { ProfileEvent& ev = threadCollection->events[i]; if(ev.id == inId.mEventId && ev.stopTime == ProfileEvent::INVALID_TIME) { ev.stopTime = timestamp; PX_ASSERT(ev.stopTime >= ev.startTime); break; } } }