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


C++ GetLink函數代碼示例

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


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

示例1: sizeof

// Initialize -- Initialize Block Heap Manager ---------------------CHeapBlock-
//
// Free Block in heap:
//		{<sizePrev/sizeNext/signPrev/signNext><<FreeLinks> data >}
//
// Allocated Block in heap:
//		{<sizePrev/sizeNext/signPrev/signNext>< data >}
//
// The Heap is as follows:
//		<sizePrev=0/sizeOf1st=n/SIGNEND/signOf1st> <data block 1> ...
//		... <data block N> <0/sizeOfN/signOfN/SIGNEND>
//
// All <data> is allocated to fall on the ALIGNSIZE byte boundry.
//
// pFree -> {1st free block}
// pAlloc-> {1st allocated block}
//
// NOTE:  Block sizes must ALWAYS be valid except in critical regions
//
ERC CHeapBlock::Initialize(U32 nFragment, U32 aP[], U32 aCb[], U16 sUnit)
{
	sUnit_ = sUnit + (ALIGNSIZE - 1) & ~ALIGNMASK;
	sSplit_= sUnit + sizeof(BLKHEAD);

	// This code assumes the heap is at least large enough for three headers

	// Make block marking beginning of heap
	pHeap_ = (BLKHEAD *)( (aP[0] + ALIGNMASK) & ~ALIGNMASK );
	pHeap_->sPrev = 0;			// End Block Marker
	pHeap_->sThis = 0;
	pHeap_->tThis = TYPEEND;
	pHeap_->pThis = this;

	// Remove 1st header from fragment for loop
	aCb[0] = aCb[0] - ((int)(pHeap_+1) - (int)aP[0]);
	aP[0] = (U32)(pHeap_+1);

	pFree_ = (BLKHEAD*)aP[0];	// 1st free block

	// Add fragments to the free list
	U32 sPrev = 0;			// First Free Block
	BLKHEAD *pPrev = NULL;
	for (int iFragment=0; iFragment < nFragment; iFragment++) {
		// Enter fragment as a free block
		BLKHEAD *pFrag = (BLKHEAD *)( (aP[iFragment] + ALIGNMASK) & ~ALIGNMASK );
		// Reduce size of fragment by amount pFrag was rounded up
		U32 sThis = aCb[iFragment] - ((int)pFrag - (int)aP[iFragment]);

		pFrag->sPrev = sPrev;
		pFrag->sThis = sThis - sizeof(BLKHEAD)*2;
		pFrag->tThis = TYPEFREE;
		pFrag->pThis = this;

		// Link this free block on the free list
		GetLink(pFrag)->pNextFree = NULL;
		GetLink(pFrag)->pPrevFree = pPrev;
		if (pPrev)
			GetLink(pPrev)->pNextFree = pFrag;

		// Enter gap between fragments as 'inuse' block, except last one which is end block
		GetNext(pFrag)->sPrev = pFrag->sThis;
		if (iFragment+1 < nFragment) {
			BLKHEAD *pNext = (BLKHEAD *)( (aP[iFragment+1] + ALIGNMASK) & ~ALIGNMASK );
			GetNext(pFrag)->sThis = (int)pNext - (int)(GetNext(pFrag)+1);
			GetNext(pFrag)->tThis = TYPEALLOC;
		}
		else {
			GetNext(pFrag)->sThis = 0; // End Block Marker
			GetNext(pFrag)->tThis = TYPEEND;
		}
		GetNext(pFrag)->pThis = this;

		pPrev = pFrag;
		sPrev = pFrag->sThis;
	}

	return OK;
}
開發者ID:JoeAltmaier,項目名稱:Odyssey,代碼行數:78,代碼來源:HeapBlock.cpp

示例2: GetLink

// _Link -- Link block to free list --------------------------------CHeapBlock-
//
void CHeapBlock::_Link(BLKHEAD *pBlk)
{
	Critical section;

	GetLink(pBlk)->pPrevFree = NULL;
	GetLink(pBlk)->pNextFree = pFree_;

	if (pFree_ != NULL)
		GetLink(pFree_)->pPrevFree = pBlk;
	
	pFree_ = pBlk;
}
開發者ID:JoeAltmaier,項目名稱:Odyssey,代碼行數:14,代碼來源:HeapBlock.cpp

示例3: IsParent

//------------------------------------------------------------------------------
bool CUIEdProjectUI::IsParent(CIwAttrInstance* inst,CIwAttrInstance* parent)
{
    CUIEdAttrLinkData* link=GetLink(inst);
    CUIEdAttrLinkData* parentLink=GetLink(parent);

    if (link==NULL || parentLink==NULL) return false;

    for (; parentLink!=NULL; parentLink=parentLink->m_Parent)
    {
        if (link==parentLink)
            return true;
    }
    return false;
}
開發者ID:SamanthaClark,項目名稱:UI-Builder,代碼行數:15,代碼來源:IwUIEdProjectUI.cpp

示例4:

/*! see CMultiXSession::CheckStatus
*/
bool	CMultiplexerClientFEClientSession::CheckStatus()
{
	if(GetLink()	==	NULL)
		Kill();
	//	by returning true we will disable the deletion of the session based on Idle timer
	return	true;
}
開發者ID:bmanojlovic,項目名稱:bforce8583,代碼行數:9,代碼來源:MultiplexerClientFEClientSession.cpp

示例5: GetLink

CMultiXLayer::EventHandlerReturn	CMultiXL3::OnAcceptCompleted(CMultiXEvent	&Event)
{
	CMultiXL2Event	*Ev	=	(CMultiXL2Event	*)&Event;

	CMultiXL3Link	*Link	=	GetLink(Ev->L2LinkID());
	if(Link	==	NULL)
	{
		CMultiXL2CloseReq	L2Req(this,LowerLayer());
		L2Req.m_L2LinkID		=	Ev->NewL2LinkID();
		LowerLayer()->RequestHandler(L2Req);
	}	else
	{
		if(Ev->IoError())
		{
			CMultiXL2CloseReq	L2Req(this,LowerLayer());
			L2Req.m_L2LinkID		=	Link->m_L2LinkID;
			LowerLayer()->RequestHandler(L2Req);
		}	else
		{
			CMultiXL3Link	*NewLink	=	CreateLink(Ev->NewL2LinkID());
			NewLink->OnAcceptCompleted(*Link);
		}
	}
	return	CMultiXLayer::DeleteEvent;
}
開發者ID:bmanojlovic,項目名稱:bforce8583,代碼行數:25,代碼來源:MultiXL3.cpp

示例6: wxCHECK_RET

void wxHtmlCell::OnMouseClick(wxWindow *, int, int, const wxMouseEvent& event)
{
    wxCHECK_RET( gs_helperOnMouseClick, wxT("unexpected call to OnMouseClick") );
    wxHtmlWindowInterface *window = gs_helperOnMouseClick->window;
    const wxPoint& pos = gs_helperOnMouseClick->pos;
#endif // WXWIN_COMPATIBILITY_2_6

    wxHtmlLinkInfo *lnk = GetLink(pos.x, pos.y);
    bool retval = false;

    if (lnk)
    {
        wxHtmlLinkInfo lnk2(*lnk);
        lnk2.SetEvent(&event);
        lnk2.SetHtmlCell(this);

        window->OnHTMLLinkClicked(lnk2);
        retval = true;
    }

#if WXWIN_COMPATIBILITY_2_6
    gs_helperOnMouseClick->retval = retval;
#else
    return retval;
#endif // WXWIN_COMPATIBILITY_2_6
}
開發者ID:CyberIntelMafia,項目名稱:clamav-devel,代碼行數:26,代碼來源:htmlcell.cpp

示例7: DebugPrint

/*!
	see CMultiXSession::OnSendMsgFailed
	We notify the associated link that the last message received from the POS terminal
	was not processed succefuly by the server application.
*/
void	CMultiplexerClientFEClientSession::OnSendMsgFailed(CMultiXAppMsg &OriginalMsg)
{
	DebugPrint(2,"Send Msg Failed\n");
		CMultiplexerClientFELink	*pLink	=	GetLink();
	if(pLink)
		pLink->OnSessionSendFailed(OriginalMsg,ErrUnableToForwardMsg);
	}
開發者ID:bmanojlovic,項目名稱:bforce8583,代碼行數:12,代碼來源:MultiplexerClientFEClientSession.cpp

示例8: GetMinimizedHeight

int Track::GetMinimizedHeight() const
{
   if (GetLink()) {
      return 20;
   }

   return 40;
}
開發者ID:ScorpioJonesy,項目名稱:audacity,代碼行數:8,代碼來源:Track.cpp

示例9: GetLink

NS_IMETHODIMP
HTMLBodyElement::GetLink(nsAString& aLink)
{
  nsString link;
  GetLink(link);
  aLink = link;
  return NS_OK;
}
開發者ID:cabelitos,項目名稱:mozilla-central,代碼行數:8,代碼來源:HTMLBodyElement.cpp

示例10: GetLink

NS_IMETHODIMP
HTMLBodyElement::GetLink(nsAString& aLink)
{
  DOMString link;
  GetLink(link);
  link.ToString(aLink);
  return NS_OK;
}
開發者ID:MekliCZ,項目名稱:positron,代碼行數:8,代碼來源:HTMLBodyElement.cpp

示例11: BuildAddress

void
CMLineAddressTable::SetExecutionPoint
	(
	const JIndex lineIndex
	)
{
	const JString addr = BuildAddress(*(itsLineTextList->GetElement(lineIndex)));
	GetLink()->SetExecutionPoint(addr);
}
開發者ID:jafl,項目名稱:jx_application_framework,代碼行數:9,代碼來源:CMLineAddressTable.cpp

示例12: GetLink

TBool CMccControllerStub::StreamsExists( TUint32 aSessionId, 
                                         TUint32 aLinkId )
    {
    TLink link;
    link.iSessionID = aSessionId;
    link.iLinkID = aLinkId;
        
    return iStreamExists == -1 ? GetLink( link ).iStreams > 0 : iStreamExists == 1;
    }
開發者ID:kuailexs,項目名稱:symbiandump-mw1,代碼行數:9,代碼來源:CMCCController_stub.cpp

示例13: GetPointPos

Image RichTextView::CursorImage(Point p, dword keyflags)
{
	int pos = GetPointPos(p);
	if(WhenLink && pos >= 0 && !IsNull(GetLink(pos, p)))
		return CtrlImg::HandCursor();
	if(HasCapture())
		return CtrlImg::ibeam0();
	return Image::Arrow();
}
開發者ID:pedia,項目名稱:raidget,代碼行數:9,代碼來源:RichTextView.cpp

示例14: GetLink

void USmartNavLinkComponent::OnApplyModifiers(FCompositeNavModifier& Modifiers)
{
	FNavigationLink LinkMod = GetLink();
	Modifiers.Add(FSimpleLinkNavModifier(LinkMod, GetOwner()->GetTransform()));

	if (bCreateBoxObstacle)
	{
		Modifiers.Add(FAreaNavModifier(FBox::BuildAABB(ObstacleOffset, ObstacleExtent), GetOwner()->GetTransform(), ObstacleAreaClass));
	}
}
開發者ID:Tigrouzen,項目名稱:UnrealEngine-4,代碼行數:10,代碼來源:SmartNavLinkComponent.cpp

示例15:

// _LockNext
// 
// Unlock block then mark next block and return -> next block.  If next
// block is corrupted then returns NULL.  If next block is END then unlock
// this block and return NULL.
BLKHEAD * CHeapBlock::_LockNext(BLKHEAD *pBlk)
{
//	Critical section;

	// Skip locked free blocks

	for(pBlk = GetLink(pBlk)->pNextFree ; pBlk != NULL; pBlk = GetLink(pBlk)->pNextFree) {
		if (pBlk->tThis == TYPEFREE) {
//			pBlk->tThis = TYPELOCK;
			break;
		}
//		if (pBlk->tThis != TYPELOCK) {
		else {
			pBlk = NULL;	//*** CORRUPTED HEAP ***
			break;
		}
	}
	
	return pBlk;
}
開發者ID:JoeAltmaier,項目名稱:Odyssey,代碼行數:25,代碼來源:HeapBlock.cpp


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