當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetCurrent函數代碼示例

本文整理匯總了C++中GetCurrent函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetCurrent函數的具體用法?C++ GetCurrent怎麽用?C++ GetCurrent使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetCurrent函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ToHead

/******************************************************************************
void IFXKeyTrack::Filter(F32 deltatime)

remove track entries too close in time

******************************************************************************/
void IFXKeyTrack::Filter(F32 deltatime)
{
	//I32 original=GetNumberElements();

	IFXListContext basecontext,nextcontext;
	IFXKeyFrame *base,*next;

	ToHead(basecontext);
	while((base=GetCurrent(basecontext)) != NULL)
	{
		nextcontext=basecontext;
		PostIncrement(nextcontext);

		if(IsAtTail(nextcontext))
			break;

		next=GetCurrent(nextcontext);

		if( (next->Time()-base->Time()) < deltatime )
		{
			Delete(next);
		}
		else
		{
			PostIncrement(basecontext);
		}
	}
}
開發者ID:ClinicalGraphics,項目名稱:MathGL,代碼行數:34,代碼來源:IFXKeyTrack.cpp

示例2: switch

void
ParamListGL::Special(int key, int /*x*/, int /*y*/)
{
    switch(key) {
    case GLUT_KEY_DOWN:
        Increment();
        break;
    case GLUT_KEY_UP:
        Decrement();
        break;
    case GLUT_KEY_RIGHT:
        GetCurrent()->Increment();
        break;
    case GLUT_KEY_LEFT:
        GetCurrent()->Decrement();
        break;
    case GLUT_KEY_HOME:
        GetCurrent()->Reset();
        break;
    case GLUT_KEY_END:
        GetCurrent()->SetPercentage(1.0);
        break;
    }
    glutPostRedisplay();
}
開發者ID:Feinbube,項目名稱:hybridNet,代碼行數:25,代碼來源:paramgl.cpp

示例3: GetCurrent

eOSState cMenuBrowseFiles::Info(void)
{
  if (GetCurrent() && !GetCurrent()->IsDir()) {
    cString filename = cString::sprintf("%s/%s", *m_CurrentDir, GetCurrent()->Name());
    return AddSubMenu(new cMetainfoMenu(filename));
  }
  return osContinue;
}
開發者ID:flensrocker,項目名稱:vdr-plugin-xineliboutput,代碼行數:8,代碼來源:menu.c

示例4: error

bool LEVELSELECT::addDirectoryListEntry(char* directoryName)
{
    if (strlen(directoryName)+1 > MAX_PATH)
    {
        error("LEVELSELECT::addLevelListEntry", "Parameter directoryName too long. Max length is MAX_PATH (%d).", MAX_PATH);
        return false;
    }

    LEVELDIRECTORY *lastDirectory = GetCurrent()->GetDirectory();
    LEVELDIRECTORY *newDirectory;

    //get last directory
    if (lastDirectory != NULL)
    {
        while (lastDirectory->next != NULL)
        {
            lastDirectory = lastDirectory->next;
        }
    }

    newDirectory = (LEVELDIRECTORY*)malloc(sizeof(LEVELDIRECTORY));
    newDirectory->prev = lastDirectory;
    newDirectory->next = NULL;
    if (lastDirectory != NULL)
    {
        lastDirectory->next = newDirectory;
        newDirectory->index = lastDirectory->index+1;
    }
    else
    {
        newDirectory->index = 0;
    }

    if (strcmp(directoryName, "..")==0)
    {
        strcpy(newDirectory->name, "");
    }
    else
    {
        strcpy(newDirectory->name, directoryName);
    }

    GetCurrent()->GetDirectoryPath(newDirectory->path, newDirectory->name);

    if (GetCurrent()->GetDirectory() == NULL)
        GetCurrent()->currentDirectory = newDirectory;
    return true;
}
開發者ID:Mathias-Gartner,項目名稱:Sokorun,代碼行數:48,代碼來源:levelselect.cpp

示例5: GetCurrent

void subPageSpells::Del()
{
	School *school = currentSchool;

	if ( school->spells.size() == 1 )
	{
		currentSpell->Clear();
		GetCurrent();
		return;
	}
	spellItr = school->spells.erase(spellItr);
	delete currentSpell;
	currentSpell = *spellItr;

	GetCurrent();
}
開發者ID:q4a,項目名稱:scourge,代碼行數:16,代碼來源:subpagespells.cpp

示例6: SetCurrent

void subPageSpells::Next(unsigned int n)
{
	SetCurrent();

	std::vector<Spell*> *pSpells = &currentSchool->spells;

	if ( n > (pSpells->size()-spellNumber) && n!=1 )
	{
		spellItr = pSpells->end();
		spellItr--;
		currentSpell = *spellItr;
		spellNumber = pSpells->size();
		return;
	}

	for ( ; n > 0; n-- )
	{
		spellItr++;
		spellNumber++;
		if ( spellItr == pSpells->end() )
		{
			spellItr = pSpells->begin();
			spellNumber = 1;
		}
		currentSpell = *spellItr;
	}

	GetCurrent();
}
開發者ID:q4a,項目名稱:scourge,代碼行數:29,代碼來源:subpagespells.cpp

示例7: NS_GetCurrentThread

bool
TaskQueue::IsCurrentThreadIn()
{
  bool in = NS_GetCurrentThread() == mRunningThread;
  MOZ_ASSERT(in == (GetCurrent() == this));
  return in;
}
開發者ID:Jar-win,項目名稱:Waterfox,代碼行數:7,代碼來源:TaskQueue.cpp

示例8: runner

nsresult
TaskQueue::DispatchLocked(already_AddRefed<nsIRunnable> aRunnable,
                               DispatchMode aMode, DispatchFailureHandling aFailureHandling,
                               DispatchReason aReason)
{
  nsCOMPtr<nsIRunnable> r = aRunnable;
  AbstractThread* currentThread;
  if (aReason != TailDispatch && (currentThread = GetCurrent()) && RequiresTailDispatch(currentThread)) {
    currentThread->TailDispatcher().AddTask(this, r.forget(), aFailureHandling);
    return NS_OK;
  }

  mQueueMonitor.AssertCurrentThreadOwns();
  if (mIsFlushing && aMode == AbortIfFlushing) {
    return NS_ERROR_ABORT;
  }
  if (mIsShutdown) {
    return NS_ERROR_FAILURE;
  }
  mTasks.push(r.forget());
  if (mIsRunning) {
    return NS_OK;
  }
  nsRefPtr<nsIRunnable> runner(new Runner(this));
  nsresult rv = mPool->Dispatch(runner.forget(), NS_DISPATCH_NORMAL);
  if (NS_FAILED(rv)) {
    NS_WARNING("Failed to dispatch runnable to run TaskQueue");
    return rv;
  }
  mIsRunning = true;

  return NS_OK;
}
開發者ID:Jar-win,項目名稱:Waterfox,代碼行數:33,代碼來源:TaskQueue.cpp

示例9: GetCurrent

Size DockCont::GetMinSize() const
{
	if (ignoreminsize) return Size(0, 0);
	Size sz = tabbar.GetCount() ? GetCurrent().GetMinSize() : Size(0, 0);
	sz = AddFrameSize(sz);
	return sz;
}
開發者ID:dreamsxin,項目名稱:ultimatepp,代碼行數:7,代碼來源:DockCont.cpp

示例10: GetCurrent

int	CoroutineMgr::Yield(int coid )
{
    Coroutine * cur = GetCurrent();
    if(!cur)
    {
		LOG_FATAL("current co is null !");
        return -1;
    }
	Coroutine * co = Find(coid);
	if(0 == coid)
	{
		//switch to prev
		co = cur->from;
	}
    if(!co)
    {
		LOG_FATAL("current from co is null !");
        return -1;
    }
	if(cur->bState == Coroutine::COROUTINE_STATUS_RUNNING)
	{
		cur->bState = Coroutine::COROUTINE_STATUS_SUSPEND;
	}
	co->bState = Coroutine::COROUTINE_STATUS_RUNNING;
    SetCurrent(co);
	LOG_INFO("co = %d is yield schedule next = %d for = %d",cur->iID,co->iID,coid);
    swapcontext(&(cur->ctx),&(co->ctx));
    return retval;
}
開發者ID:jj4jj,項目名稱:ssukits,代碼行數:29,代碼來源:Coroutine.cpp

示例11: GetCurrent

void VirtualHost::UpdateSerializationSizeLimit() {
  const VirtualHost *vh = GetCurrent();
  assert(vh);
  if (vh->m_runtimeOption.serializationSizeLimit != StringData::MaxSize) {
    VariableSerializer::serializationSizeLimit =
      vh->m_runtimeOption.serializationSizeLimit;
  }
}
開發者ID:SinnerShanky,項目名稱:hhvm,代碼行數:8,代碼來源:virtual-host.cpp

示例12: GetCurrent

const vector<string> &VirtualHost::GetAllowedDirectories() {
  const VirtualHost *vh = GetCurrent();
  ASSERT(vh);
  if (!vh->m_runtimeOption.allowedDirectories.empty()) {
    return vh->m_runtimeOption.allowedDirectories;
  }
  return RuntimeOption::AllowedDirectories;
}
開發者ID:yongki,項目名稱:hiphop-php,代碼行數:8,代碼來源:virtual_host.cpp

示例13: Unbind

void Shader::Unbind()
{
	if(GetCurrent() != nullptr)
	{
		glUseProgram(0);
		SetCurrent(nullptr);
	}
}
開發者ID:jjiezheng,項目名稱:lfant,代碼行數:8,代碼來源:Shader.cpp

示例14: Bind

void Shader::Bind()
{
	if(GetCurrent() != this)
	{
		glUseProgram(id);
		SetCurrent(this);
	}
}
開發者ID:jjiezheng,項目名稱:lfant,代碼行數:8,代碼來源:Shader.cpp

示例15: DrawMeter

void FProgress::DrawMeter(CDC& dc, FRect& rcPaint)
{

	//fill the unavailable 
	int nLines = rcPaint.Width() / (gLineDistance + gPenWidth) + 1; 

	int nAvailLines = (int)GetAvail((double)nLines) ;
	int nCurrLines  = (int)GetCurrent((double)nLines);
	
	assert(nAvailLines >= nCurrLines);

	int x = rcPaint.left; 
	int y = rcPaint.top; 

	dc.MoveTo(x, y); 

	int lh = rcPaint.Height() - 0; 
	int mh = lh; 

	int nPenIndex = 2; 
	dc.SelectPen(m_Pens[nPenIndex]); 
	dword dwStyle = GetWindowLong(GWL_STYLE); 

	for (int k = 0; k < nLines; k++)
	{
		if (k == nCurrLines)
		{
			if (k < nAvailLines)
				dc.SelectPen(m_Pens[1]);	
			else
				dc.SelectPen(m_Pens[0]);
			if (dwStyle & PROG_LARGER_CURRENT)
			{
				lh = lh / 2; 
				y += lh / 2; 
				dc.MoveTo(x, y);  
			}
		}
		else if (k == nAvailLines)
		{
			dc.SelectPen(m_Pens[0]); 
		}

		if (dwStyle & PROG_GROWING)
		{
			double dblNow = (double)k / (double)nLines; 
			lh = (int)(mh * dblNow); 
			y = mh - lh; 
			dc.MoveTo(x, y); 
		}

		dc.LineTo(x, y + lh);
		x += gLineDistance; 
		x += gPenWidth;
		dc.MoveTo(x, y); 
	}
}
開發者ID:codeboost,項目名稱:libertv,代碼行數:57,代碼來源:FControls.cpp


注:本文中的GetCurrent函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。