Пример #1
0
void Listener::insertEntry(UtlString& rKey,
                           CallObject* newObject)
{
   OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_DEBUG, "Listener::insertEntry - Putting %p into the call pool for callId %s\n",
                 newObject, rKey.data());

   OsWriteLock lock(mRWMutex);
   ActiveCall  tempEntry(rKey, newObject);
   ActiveCall* pOldEntry;
   unsigned int       i;
   i = mCalls.index(&tempEntry);
   if (i != UTL_NOT_FOUND)
   {                             // we already have an entry with this key
      pOldEntry = (ActiveCall *)mCalls.at(i);
      OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_WARNING, "Listener::insertEntry - FOUND %s\n", rKey.data());
   }
   else
   {
      ActiveCall* pNewEntry = new ActiveCall(rKey, newObject);
      mCalls.insert(pNewEntry);

      OsSysLog::add(FAC_MEDIASERVER_VXI, PRI_DEBUG, "Listener::insertEntry - inserted %s\n", rKey.data());

      mTotalCalls++;
   }
}
Пример #2
0
		void removeFile(const String& name, bool imitEvents = true)
		{
			// bsearch
			KEvent target;
			EntryStruct tempEntry(name.c_str(), 0);
			target.udata = &tempEntry;
			KEvent* ke = (KEvent*)bsearch(&target, &mChangeList, mChangeListCount + 1, sizeof(KEvent), comparator);
			if(!ke)
				throw FileNotFoundException(name);

			tempEntry.mFilename = 0;
			
			// delete
			close(ke->ident);
			delete((EntryStruct*)ke->udata);
			memset(ke, 0, sizeof(KEvent));
			
			// move end to current
			memcpy(ke, &mChangeList[mChangeListCount], sizeof(KEvent));
			memset(&mChangeList[mChangeListCount], 0, sizeof(KEvent));
			--mChangeListCount;
			
			// qsort
			qsort(mChangeList + 1, mChangeListCount, sizeof(KEvent), comparator);
			
			// handle action
			if(imitEvents)
				handleAction(name, Actions::Delete);
		}
Пример #3
0
// This function calls any function that should be called when this animation finishes
void AnimationManager::finishedAnimation(AnimationEntry entry)
{
	FinishedCallBack fnCb = entry.getCallback();
	AnimationEntry tempEntry(entry.getObject(), entry.getCallback(), entry.getCustomData());
	Animatable *obj = entry.getObject();

	// Kill off the entry so there are no dangling pointers
	removeAnimation(entry.getObject());

	if (obj)
	{
		// ALow the object to finish properly
		obj->onAnimFinished();
	}	

	if (fnCb)
	{
		// Finish this animation by calling the callback function specified
		fnCb(tempEntry);
	}

	textManager->invalidate();
	rndrManager->invalidateRenderer();
}