本文整理汇总了C++中GetHeadPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHeadPosition函数的具体用法?C++ GetHeadPosition怎么用?C++ GetHeadPosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHeadPosition函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetHeadPosition
BOOL CNetworkAdapterList::SetIpAddrEntry(LONG lIfIndex, LPCTSTR lpstrIPAddr, LPCTSTR lpstrIPNetMask, LPCTSTR lpstrNetNumber)
{
CNetworkAdapter cAdapter;
POSITION pPosCur,
pPosNext;
pPosNext = GetHeadPosition();
pPosCur = GetHeadPosition();
while (pPosNext != NULL)
{
cAdapter = GetNext( pPosNext);
if (cAdapter.GetIfIndex() == lIfIndex)
{
// That's the adapter to update
cAdapter.SetIPAddress( lpstrIPAddr);
cAdapter.SetIPNetMask( lpstrIPNetMask);
cAdapter.SetNetNumber( lpstrNetNumber );
SetAt( pPosCur, cAdapter);
return TRUE;
}
// Browse the next adapter and save the adapter position in the list
pPosCur = pPosNext;
}
return FALSE;
}
开发者ID:GoGoogle,项目名称:WindowsAgent,代码行数:25,代码来源:NetworkAdapterList.cpp
示例2: assert
NEPointerList* NEPointerList::getElementsWithShortestDurationNotNull()
{
assert(!empty());
NEPointerList* list=new NEPointerList;
GRNotationElement * e = NULL;
GuidoPos pos=GetHeadPosition();
TYPE_DURATION dur(INT_MAX,1);
while (pos)
{
e = GetNext(pos);
if (e->getDuration() < dur
&& e->getDuration() > DURATION_0)
dur = e->getDuration();
}
pos = GetHeadPosition();
while (pos)
{
e = GetNext(pos);
if (e->getDuration() == dur)
{
list->push_back(e);
}
}
return list;
}
开发者ID:EQ4,项目名称:guido-engine,代码行数:25,代码来源:NEPointerList.cpp
示例3: DeleteAllItems
void CXTPDockingPaneTabbedContainer::OnTabsChanged()
{
if (!m_hWnd)
return;
m_nLockReposition += 1;
DeleteAllItems();
m_bCloseItemButton = GetDockingPaneManager()->m_bShowCloseTabButton;
POSITION pos = GetHeadPosition();
while (pos)
{
CXTPDockingPane* pPane = (CXTPDockingPane*)GetNext(pos);
CXTPTabManagerItem* pItem = AddItem(GetItemCount());
if (m_pSelectedPane == pPane) SetSelectedItem(pItem);
pItem->SetCaption(pPane->GetTabCaption());
pItem->SetColor(pPane->GetItemColor());
pItem->SetTooltip(pPane->GetTitle());
pItem->SetEnabled(pPane->GetEnabled() & xtpPaneEnableClient);
pItem->SetClosable((pPane->GetOptions() & xtpPaneNoCloseable) == 0);
pItem->SetData((DWORD_PTR)pPane);
}
//////////////////////////////////////////////////////////////////////////
m_pCaptionButtons->CheckForMouseOver(CPoint(-1, -1));
m_nLockReposition -= 1;
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:33,代码来源:XTPDockingPaneTabbedContainer.cpp
示例4: OnTabsChanged
void CXTPDockingPaneTabbedContainer::InvalidatePane(BOOL bSelectionChanged)
{
if (!GetSafeHwnd())
return;
if (m_pParentContainer == 0)
return;
if (m_nLockReposition)
return;
m_nLockReposition += 1;
OnTabsChanged();
m_nLockReposition -= 1;
CRect rect = m_rcWindow;
CXTPDockingPaneBase::GetPaintManager()->AdjustClientRect(this, rect, TRUE);
if (bSelectionChanged)
{
POSITION pos = GetHeadPosition();
while (pos)
{
CXTPDockingPane* pPane = (CXTPDockingPane*)GetNext(pos);
CRect rcPane = m_pSelectedPane == pPane ? rect : CRect(0, 0, 0, 0);
pPane->OnSizeParent(m_pDockingSite, rcPane, 0);
}
}
Invalidate(FALSE);
m_pParentContainer->InvalidatePane(bSelectionChanged);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:32,代码来源:XTPDockingPaneTabbedContainer.cpp
示例5: AdjustMinMaxInfoClientRect
void CXTPDockingPaneTabbedContainer::GetMinMaxInfo(LPMINMAXINFO pMinMaxInfo) const
{
CXTPDockingPaneBase::GetMinMaxInfo(pMinMaxInfo);
if (IsEmpty())
return;
if (IsPaneMinimized())
{
if (((CXTPDockingPaneSplitterContainer*)m_pParentContainer)->IsHoriz())
pMinMaxInfo->ptMaxTrackSize.x = 0;
else
pMinMaxInfo->ptMaxTrackSize.y = 0;
AdjustMinMaxInfoClientRect(pMinMaxInfo, FALSE);
}
else
{
POSITION pos = GetHeadPosition();
while (pos)
{
CXTPDockingPaneBase* pPane = GetNext(pos);
MINMAXINFO info;
pPane->GetMinMaxInfo(&info);
pMinMaxInfo->ptMinTrackSize.x = max(pMinMaxInfo->ptMinTrackSize.x, info.ptMinTrackSize.x);
pMinMaxInfo->ptMinTrackSize.y = max(pMinMaxInfo->ptMinTrackSize.y, info.ptMinTrackSize.y);
pMinMaxInfo->ptMaxTrackSize.x = min(pMinMaxInfo->ptMaxTrackSize.x, info.ptMaxTrackSize.x);
pMinMaxInfo->ptMaxTrackSize.y = min(pMinMaxInfo->ptMaxTrackSize.y, info.ptMaxTrackSize.y);
}
AdjustMinMaxInfoClientRect(pMinMaxInfo);
}
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:35,代码来源:XTPDockingPaneTabbedContainer.cpp
示例6: ASSERT_VALID
//
// remove the single unit indicated by the dwID (with optional flag
// to delete the actual object too)
//
void CAIUnitList::RemoveUnit( DWORD dwID, BOOL bObjectToo /*=TRUE*/ )
{
ASSERT_VALID( this );
// no need to remove that which is not there
CAIUnit *pUnit = GetUnit( dwID );
if( pUnit == NULL )
return;
POSITION pos1, pos2;
for( pos1 = GetHeadPosition();
( pos2 = pos1 ) != NULL; )
{
pUnit = (CAIUnit *)GetNext( pos1 );
if( pUnit != NULL )
{
ASSERT_VALID( pUnit );
if( pUnit->GetID() != dwID )
continue;
}
pUnit = (CAIUnit *)GetAt( pos2 );
if( pUnit != NULL )
{
ASSERT_VALID( pUnit );
RemoveAt( pos2 );
if( bObjectToo )
delete pUnit;
break;
}
}
}
开发者ID:Marenz,项目名称:EnemyNations,代码行数:38,代码来源:caiunit.cpp
示例7: GetHeadPosition
//
// count number of vehicle units which have the passed dwID in
// their dwData, indicating this is unit assigned for repair
// at that repair center
//
int CAIUnitList::GetRepairCount( int iPlayer, DWORD dwRepBldg )
{
int iCount = 0;
POSITION pos = GetHeadPosition();
while( pos != NULL )
{
CAIUnit *pUnit = (CAIUnit *)GetNext( pos );
if( pUnit != NULL )
{
#if 0 //THREADS_ENABLED
// BUGBUG this function must yield
myYieldThread();
//if( myYieldThread() == TM_QUIT )
// throw(ERR_CAI_TM_QUIT); // THROW( pException );
#endif
ASSERT_VALID( pUnit );
if( pUnit->GetOwner() != iPlayer )
continue;
if( pUnit->GetType() != CUnit::vehicle )
continue;
// this vehicle is assigned to be repaired at the
// repair center passed in
if( pUnit->GetDataDW() == dwRepBldg )
iCount++;
}
}
return( iCount );
}
开发者ID:Marenz,项目名称:EnemyNations,代码行数:35,代码来源:caiunit.cpp
示例8: SetFirstRecord
// 1. Satz über seine Buchmarke akt.
BOOL CPtrListExt :: SetFirstRecord (COleVariant varBookmark, const char *pAbfallArt/* = NULL*/)
{
if ((VT_EMPTY == varBookmark.vt) || IsEmpty ())
return FALSE;
BOOL bFound = FALSE;
POSITION pos = GetHeadPosition();
CRecordInfo *pInfo = NULL;
while (pos != NULL)
{
pInfo = (CRecordInfo *) GetNext(pos);
ASSERT (NULL != pInfo);
if (!bFound && (varBookmark == pInfo -> m_varBookMark))
{
bFound = TRUE;
pInfo -> m_bFirst = TRUE;
// ggf. Art ändern
if (pAbfallArt && *pAbfallArt)
pInfo -> m_strAbfArt = pAbfallArt;
}
else
pInfo -> m_bFirst = FALSE;
}
return bFound;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:28,代码来源:Abfset.cpp
示例9: __rdtsc
void GSRasterizerList::Draw(const GSRasterizerData* data)
{
*m_sync = 0;
m_stats.Reset();
__int64 start = __rdtsc();
POSITION pos = GetTailPosition();
while(pos)
{
GetPrev(pos)->Draw(data);
}
while(*m_sync)
{
_mm_pause();
}
m_stats.ticks = __rdtsc() - start;
pos = GetHeadPosition();
while(pos)
{
GSRasterizerStats s;
GetNext(pos)->GetStats(s);
m_stats.pixels += s.pixels;
m_stats.prims = max(m_stats.prims, s.prims);
}
}
开发者ID:0xZERO3,项目名称:PCSX2-rr-lua,代码行数:34,代码来源:GSRasterizer.cpp
示例10: GetDockingPaneManager
CRect CXTPDockingPaneSplitterContainer::_CalculateResultDockingRectSelf(CXTPDockingPaneBase* pPaneI, XTPDockingPaneDirection direction, CXTPDockingPaneBase* pNeighbour)
{
direction = GetDockingPaneManager()->GetRTLDirection(direction);
ASSERT(pNeighbour);
BOOL bAfter = (direction == xtpPaneDockRight || direction == xtpPaneDockBottom);
// getting list of nonempty panes
CXTPDockingPaneBaseList lst;
POSITION posPanes = GetHeadPosition();
while (posPanes)
{
CXTPDockingPaneBase* pPane = GetNext(posPanes);
if (pPane->IsEmpty() || (pPane == pPaneI))
continue;
POSITION pos = lst.AddTail(pPane);
if (pPane == pNeighbour)
{
if (bAfter)
lst.InsertAfter(pos, pPaneI);
else
lst.InsertBefore(pos, pPaneI);
}
}
CRect rcResult = _CalculateResultDockingRect(m_bHoriz, lst, m_rcWindow, pPaneI);
m_pDockingSite->ClientToScreen(rcResult);
return rcResult;
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:35,代码来源:XTPDockingPaneSplitterContainer.cpp
示例11: _InsertPane
void CXTPDockingPaneSplitterContainer::_InsertPane(CXTPDockingPaneBase* pPane, CXTPDockingPaneBase* pNeighbour, BOOL bAfter)
{
POSITION pos = pNeighbour ? m_lstPanes.Find(pNeighbour) : NULL;
if (bAfter)
{
if (pos == NULL) pos = m_lstPanes.GetTailPosition();
m_lstPanes.InsertAfter(pos, pPane);
}
else
{
if (pos == NULL) pos = GetHeadPosition();
m_lstPanes.InsertBefore(pos, pPane);
}
pPane->m_pParentContainer = this;
pPane->SetDockingSite(GetDockingSite());
GetDockingPaneManager()->RecalcFrameLayout(this, TRUE);
_UpdateSplitters();
if (m_pParentContainer)
{
m_pParentContainer->OnChildContainerChanged(this);
}
pPane->OnParentContainerChanged(this);
}
开发者ID:killbug2004,项目名称:ghost2013,代码行数:29,代码来源:XTPDockingPaneSplitterContainer.cpp
示例12: GetHeadPosition
LPCTSTR CInputDeviceList::GetHash()
{
COcsCrypto myHash;
CInputDevice myObject;
POSITION pos;
BOOL bContinue;
CString csToHash;
if (GetCount() == 0)
return NULL;
if (!myHash.HashInit())
return NULL;
pos = GetHeadPosition();
bContinue = (pos != NULL);
if (bContinue)
// There is one record => get the first
myObject = GetNext( pos);
while (bContinue)
{
csToHash.Format( _T( "%s%s%s%s%s%s"), myObject.GetType(), myObject.GetManufacturer(),
myObject.GetCaption(), myObject.GetDescription(), myObject.GetPointingInterface(),
myObject.GetPointingType());
myHash.HashUpdate( csToHash);
bContinue = (pos != NULL);
if (bContinue)
myObject = GetNext( pos);
}
return myHash.HashFinal();
}
开发者ID:GoGoogle,项目名称:WindowsAgent,代码行数:29,代码来源:InputDeviceList.cpp
示例13: GetHeadPosition
void CSUIBtnList::OnSize(CRect WndRect){
POSITION pos = GetHeadPosition();
while(pos){
CSUIButton* cBtn = GetNext(pos);
cBtn->OnSize(WndRect);
}
}
开发者ID:Fluffiest,项目名称:splayer,代码行数:7,代码来源:SUIButton.cpp
示例14: GetHeadPosition
LPCTSTR CVideoAdapterList::GetHash()
{
COcsCrypto myHash;
CVideoAdapter myObject;
POSITION pos;
BOOL bContinue;
CString csToHash;
if (!myHash.HashInit())
return NULL;
pos = GetHeadPosition();
bContinue = (pos != NULL);
if (bContinue)
// There is one record => get the first
myObject = GetNext( pos);
while (bContinue)
{
csToHash.Format( _T( "%s%s%s%s"), myObject.GetName(), myObject.GetChipset(),
myObject.GetMemory(), myObject.GetScreenResolution());
myHash.HashUpdate( LPCTSTR( csToHash), csToHash.GetLength());
bContinue = (pos != NULL);
if (bContinue)
myObject = GetNext( pos);
}
return myHash.HashFinal();
}
开发者ID:shilinxu,项目名称:hcmus-it-asset-management,代码行数:26,代码来源:VideoAdapterList.cpp
示例15: return
BOOL CValueList::Save(const char *pszFilename)
{
CString strFile;
if (!pszFilename)
strFile = m_strFile;
else
strFile = pszFilename;
CFile file;
if (!file.Open(strFile,CFile::modeWrite|CFile::modeCreate))
return(FALSE);
CArchive ar(&file,CArchive::store);
ar << GetCount();
CValueItem vi;
POSITION pos = GetHeadPosition();
while(pos)
{
vi = GetNext(pos);
ar << vi.m_strText;
ar << vi.m_nValue;
}
ar.Close();
file.Close();
return(TRUE);
}
开发者ID:devurandom,项目名称:shadowkeeper,代码行数:31,代码来源:ValueList.cpp
示例16: GetCount
// Calling this function with bEnable equals to true when
// shuffle is already enabled will re-shuffle the tracks.
void CPlaylist::SetShuffle(bool bEnable)
{
m_bShuffle = bEnable;
if (bEnable && !IsEmpty()) {
m_nShuffledListSize = GetCount();
CAtlArray<plsort_t> positions;
positions.SetCount(m_nShuffledListSize + 1);
srand((unsigned int)time(nullptr));
POSITION pos = GetHeadPosition();
for (size_t i = 0; pos; i++, GetNext(pos)) {
positions[i].n = rand();
positions[i].pos = pos;
}
qsort(positions.GetData(), m_nShuffledListSize, sizeof(plsort_t), compare);
positions[m_nShuffledListSize].pos = nullptr; // Termination
m_posHeadShuffle = positions[0].pos;
m_posTailShuffle = nullptr;
for (size_t i = 0; i < m_nShuffledListSize; i++) {
pos = positions[i].pos;
CPlaylistItem& pli = GetAt(pos);
pli.m_posPrevShuffle = m_posTailShuffle;
pli.m_posNextShuffle = positions[i + 1].pos;
m_posTailShuffle = pos;
}
} else {
m_posHeadShuffle = m_posTailShuffle = nullptr;
m_nShuffledListSize = 0;
}
}
开发者ID:1ldk,项目名称:mpc-hc,代码行数:33,代码来源:Playlist.cpp
示例17: GetHeadPosition
LPCTSTR CSystemSlotList::GetHash()
{
COcsCrypto myHash;
CSystemSlot myObject;
POSITION pos;
BOOL bContinue;
CString csToHash;
if (GetCount() == 0)
return NULL;
if (!myHash.HashInit())
return NULL;
pos = GetHeadPosition();
bContinue = (pos != NULL);
if (bContinue)
// There is one record => get the first
myObject = GetNext( pos);
while (bContinue)
{
csToHash.Format( _T( "%s%s%s%s%s"), myObject.GetName(), myObject.GetDescription(),
myObject.GetSlotDesignation(), myObject.GetUsage(), myObject.GetStatus());
myHash.HashUpdate( csToHash);
bContinue = (pos != NULL);
if (bContinue)
myObject = GetNext( pos);
}
return myHash.HashFinal();
}
开发者ID:jxSandy,项目名称:WindowsAgent,代码行数:28,代码来源:SystemSlotList.cpp
示例18: GetHeadPosition
LPCTSTR CModemList::GetHash()
{
COcsCrypto myHash;
CModem myObject;
POSITION pos;
BOOL bContinue;
CString csToHash;
if (!myHash.HashInit())
return NULL;
pos = GetHeadPosition();
bContinue = (pos != NULL);
if (bContinue)
// There is one record => get the first
myObject = GetNext( pos);
while (bContinue)
{
csToHash.Format( _T( "%s%s%s%s"), myObject.GetName(), myObject.GetModel(),
myObject.GetDescription(), myObject.GetType());
myHash.HashUpdate( LPCTSTR( csToHash), csToHash.GetLength());
bContinue = (pos != NULL);
if (bContinue)
myObject = GetNext( pos);
}
return myHash.HashFinal();
}
开发者ID:shilinxu,项目名称:hcmus-it-asset-management,代码行数:26,代码来源:ModemList.cpp
示例19: GetHeadPosition
LPCTSTR CMemorySlotList::GetHash()
{
COcsCrypto myHash;
CMemorySlot myObject;
POSITION pos;
BOOL bContinue;
static CString csToHash;
if (GetCount() == 0)
return NULL;
if (!myHash.HashInit())
return NULL;
pos = GetHeadPosition();
bContinue = (pos != NULL);
if (bContinue)
// There is one record => get the first
myObject = GetNext( pos);
while (bContinue)
{
csToHash.Format( _T( "%s%s%s%s%s%s%u%s"), myObject.GetCaption(), myObject.GetDescription(),
myObject.GetCapacity(), myObject.GetUsage(), myObject.GetType(),
myObject.GetSpeed(), myObject.GetSlotNumber(), myObject.GetSN());
myHash.HashUpdate( csToHash);
bContinue = (pos != NULL);
if (bContinue)
myObject = GetNext( pos);
}
return myHash.HashFinal();
}
开发者ID:GoGoogle,项目名称:WindowsAgent,代码行数:29,代码来源:MemorySlotList.cpp
示例20: ASSERT
POSITION CPlaylist::Shuffle()
{
static INT_PTR idx = 0;
static INT_PTR count = 0;
static CAtlArray<plsort_t> a;
ASSERT(GetCount() > 2);
// insert or remove items in playlist, or index out of bounds then recalculate
if ((count != GetCount()) || (idx >= GetCount())) {
a.RemoveAll();
idx = 0;
a.SetCount(count = GetCount());
POSITION pos = GetHeadPosition();
for (INT_PTR i = 0; pos; i++, GetNext(pos)) {
a[i].pos = pos; // initialize position array
}
//Use Fisher-Yates shuffle algorithm
srand((unsigned)time(nullptr));
for (INT_PTR i = 0; i < (count - 1); i++) {
INT_PTR r = i + (rand() % (count - i));
POSITION temp = a[i].pos;
a[i].pos = a[r].pos;
a[r].pos = temp;
}
}
return a[idx++].pos;
}
开发者ID:GottfriedCP,项目名称:mpc-hc,代码行数:30,代码来源:Playlist.cpp
注:本文中的GetHeadPosition函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论