本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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);
}
示例8: GetMinimizedHeight
int Track::GetMinimizedHeight() const
{
if (GetLink()) {
return 20;
}
return 40;
}
示例9: GetLink
NS_IMETHODIMP
HTMLBodyElement::GetLink(nsAString& aLink)
{
nsString link;
GetLink(link);
aLink = link;
return NS_OK;
}
示例10: GetLink
NS_IMETHODIMP
HTMLBodyElement::GetLink(nsAString& aLink)
{
DOMString link;
GetLink(link);
link.ToString(aLink);
return NS_OK;
}
示例11: BuildAddress
void
CMLineAddressTable::SetExecutionPoint
(
const JIndex lineIndex
)
{
const JString addr = BuildAddress(*(itsLineTextList->GetElement(lineIndex)));
GetLink()->SetExecutionPoint(addr);
}
示例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;
}
示例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();
}
示例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));
}
}
示例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;
}