void HardwareIsoVertexShadow::clear() { { OGRE_LOCK_RW_MUTEX_WRITE(_mutex); delete _pBuilderQueue; _pBuilderQueue = NULL; for (unsigned i = 0; i < _nCountResolutions; ++i) _vpResolutions[i] ->clearAll(); } }
HardwareIsoVertexShadow::~HardwareIsoVertexShadow() { { OGRE_LOCK_RW_MUTEX_WRITE(_mutex); for (unsigned i = 0; i < _nCountResolutions; ++i) delete _vpResolutions[i]; delete [] _vpResolutions; delete _pBuilderQueue; } }
//--------------------------------------------------------------------- void DefaultWorkQueueBase::addRequestHandler(uint16 channel, RequestHandler* rh) { OGRE_LOCK_RW_MUTEX_WRITE(mRequestHandlerMutex); RequestHandlerListByChannel::iterator i = mRequestHandlers.find(channel); if (i == mRequestHandlers.end()) i = mRequestHandlers.insert(RequestHandlerListByChannel::value_type(channel, RequestHandlerList())).first; RequestHandlerList& handlers = i->second; if (std::find(handlers.begin(), handlers.end(), rh) == handlers.end()) handlers.push_back(rh); }
//--------------------------------------------------------------------- void DefaultWorkQueueBase::removeRequestHandler(uint16 channel, RequestHandler* rh) { OGRE_LOCK_RW_MUTEX_WRITE(mRequestHandlerMutex); RequestHandlerListByChannel::iterator i = mRequestHandlers.find(channel); if (i != mRequestHandlers.end()) { RequestHandlerList& handlers = i->second; RequestHandlerList::iterator j = std::find( handlers.begin(), handlers.end(), rh); if (j != handlers.end()) handlers.erase(j); } }
//--------------------------------------------------------------------- void DefaultWorkQueueBase::addRequestHandler(uint16 channel, RequestHandler* rh) { OGRE_LOCK_RW_MUTEX_WRITE(mRequestHandlerMutex); RequestHandlerListByChannel::iterator i = mRequestHandlers.find(channel); if (i == mRequestHandlers.end()) i = mRequestHandlers.insert(RequestHandlerListByChannel::value_type(channel, RequestHandlerList())).first; RequestHandlerList& handlers = i->second; bool duplicate = false; for (RequestHandlerList::iterator j = handlers.begin(); j != handlers.end(); ++j) { if ((*j)->getHandler() == rh) { duplicate = true; break; } } if (!duplicate) handlers.push_back(RequestHandlerHolderPtr(OGRE_NEW RequestHandlerHolder(rh))); }
//--------------------------------------------------------------------- void DefaultWorkQueueBase::removeRequestHandler(uint16 channel, RequestHandler* rh) { OGRE_LOCK_RW_MUTEX_WRITE(mRequestHandlerMutex); RequestHandlerListByChannel::iterator i = mRequestHandlers.find(channel); if (i != mRequestHandlers.end()) { RequestHandlerList& handlers = i->second; for (RequestHandlerList::iterator j = handlers.begin(); j != handlers.end(); ++j) { if ((*j)->getHandler() == rh) { // Disconnect - this will make it safe across copies of the list // this is threadsafe and will wait for existing processes to finish (*j)->disconnectHandler(); handlers.erase(j); break; } } } }