本文整理汇总了C++中NextItem函数的典型用法代码示例。如果您正苦于以下问题:C++ NextItem函数的具体用法?C++ NextItem怎么用?C++ NextItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NextItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ListSort
void DBVPolyIF::FourColoring ()
{
char nameStr [DBStringLength];
DBInt symbol, maxSymbol = 0, line, index;
DBObjRecord *polyRec,*searchPoly, *neighborPolyRec, *lineRec, *symRec;
for (polyRec = FirstItem ();polyRec != (DBObjRecord *) NULL;polyRec = NextItem ())
SymbolFLD->Record (polyRec,(DBObjRecord *) NULL);
ListSort (LineNumFLD);
for (searchPoly = FirstItem ();searchPoly != (DBObjRecord *) NULL;searchPoly = NextItem ())
{
if (((DBInt) (SymbolFLD->Record (searchPoly) - (DBObjRecord *) NULL)) != 0) continue;
DBPause (searchPoly->RowID () * 100 / ItemNum ());
symbol = 1;
Restart:
for (polyRec = ItemTable->First (&index);polyRec != (DBObjRecord *) NULL;polyRec = ItemTable->Next (&index))
{
if (strcmp (polyRec->Name (),searchPoly->Name ()) != 0) continue;
lineRec = FirstLine (polyRec);
for (line = 0;line <= LineNum (polyRec);++line)
{
if (LineRightPoly (lineRec) == polyRec)
{
neighborPolyRec = LineLeftPoly (lineRec);
lineRec = LineNextLine (lineRec);
}
else
{
neighborPolyRec = LineRightPoly (lineRec);
lineRec = LinePrevLine (lineRec);
}
if (neighborPolyRec == (DBObjRecord *) NULL) continue;
if (SymbolFLD->Record (neighborPolyRec) == (DBObjRecord *) symbol)
{ symbol++; goto Restart; }
}
}
for (polyRec = ItemTable->First (&index);polyRec != (DBObjRecord *) NULL;polyRec = ItemTable->Next (&index))
if (strcmp (polyRec->Name (),searchPoly->Name ()) == 0) SymbolFLD->Record (polyRec,(DBObjRecord *) symbol);
maxSymbol = maxSymbol > symbol ? maxSymbol : symbol;
}
while (maxSymbol < SymbolTable->ItemNum ()) SymbolTable->Remove (SymbolTable->ItemNum () - 1);
while (maxSymbol > SymbolTable->ItemNum ()) SymbolTable->Add ();
for (symbol = 0;symbol < SymbolTable->ItemNum ();++symbol)
{
symRec = SymbolTable->Item (symbol);
sprintf (nameStr,"Symbol:%2d",symbol);
symRec->Name (nameStr);
StyleFLD->Int (symRec,0);
ForegroundFLD->Int (symRec,1);
BackgroundFLD->Int (symRec,0);
}
for (polyRec = FirstItem ();polyRec != (DBObjRecord *) NULL;polyRec = NextItem ())
SymbolFLD->Record (polyRec,SymbolTable->Item ((DBInt) (SymbolFLD->Record (polyRec) - (DBObjRecord *) NULL) - 1));
ListReset ();
}
开发者ID:amiara,项目名称:RGIS,代码行数:56,代码来源:DBVPolyMisc.C
示例2: SHRemoveDataBlock
/*************************************************************************
* @ [SHLWAPI.21]
*
* Remove an item from a DataBlock list.
*
* PARAMS
* lppList [O] List to remove the item from
* ulId [I] Id of item to remove
*
* RETURNS
* Success: TRUE.
* Failure: FALSE, If any parameters are invalid, or the item was not found.
*
* NOTES
* See SHWriteDataBlockList.
*/
BOOL WINAPI SHRemoveDataBlock(LPSHLWAPI_CLIST* lppList, ULONG ulId)
{
LPSHLWAPI_CLIST lpList = 0;
LPSHLWAPI_CLIST lpItem = NULL;
LPSHLWAPI_CLIST lpNext;
ULONG ulNewSize;
TRACE("(%p,%ld)\n", lppList, ulId);
if(lppList && (lpList = *lppList))
{
/* Search for item in list */
while (lpList->ulSize)
{
if(lpList->ulId == ulId ||
(lpList->ulId == CLIST_ID_CONTAINER && lpList[1].ulId == ulId))
{
lpItem = lpList; /* Found */
break;
}
lpList = NextItem(lpList);
}
}
if(!lpItem)
return FALSE;
lpList = lpNext = NextItem(lpItem);
/* Locate the end of the list */
while (lpList->ulSize)
lpList = NextItem(lpList);
/* Resize the list */
ulNewSize = LocalSize((HLOCAL)*lppList) - lpItem->ulSize;
/* Copy following elements over lpItem */
memmove(lpItem, lpNext, (char *)lpList - (char *)lpNext + sizeof(ULONG));
if(ulNewSize <= sizeof(ULONG))
{
LocalFree((HLOCAL)*lppList);
*lppList = NULL; /* Removed the last element */
}
else
{
lpList = (LPSHLWAPI_CLIST)LocalReAlloc((HLOCAL)*lppList, ulNewSize,
LMEM_ZEROINIT|LMEM_MOVEABLE);
if(lpList)
*lppList = lpList;
}
return TRUE;
}
开发者ID:howard5888,项目名称:wineT,代码行数:69,代码来源:clist.c
示例3: SHRemoveDataBlock
/*************************************************************************
* @ [SHLWAPI.21]
*
* Remove an item from a DataBlock list.
*
* PARAMS
* lppList [O] List to remove the item from
* dwSignature [I] Id of item to remove
*
* RETURNS
* Success: TRUE.
* Failure: FALSE, If any parameters are invalid, or the item was not found.
*
* NOTES
* See SHWriteDataBlockList.
*/
BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature)
{
LPDATABLOCK_HEADER lpList = 0;
LPDATABLOCK_HEADER lpItem = NULL;
LPDATABLOCK_HEADER lpNext;
ULONG ulNewSize;
TRACE("(%p,%d)\n", lppList, dwSignature);
if(lppList && (lpList = *lppList))
{
/* Search for item in list */
while (lpList->cbSize)
{
if(lpList->dwSignature == dwSignature ||
(lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature))
{
lpItem = lpList; /* Found */
break;
}
lpList = NextItem(lpList);
}
}
if(!lpItem)
return FALSE;
lpList = lpNext = NextItem(lpItem);
/* Locate the end of the list */
while (lpList->cbSize)
lpList = NextItem(lpList);
/* Resize the list */
ulNewSize = LocalSize(*lppList) - lpItem->cbSize;
/* Copy following elements over lpItem */
memmove(lpItem, lpNext, (char *)lpList - (char *)lpNext + sizeof(ULONG));
if(ulNewSize <= sizeof(ULONG))
{
LocalFree(*lppList);
*lppList = NULL; /* Removed the last element */
}
else
{
lpList = LocalReAlloc(*lppList, ulNewSize, LMEM_ZEROINIT|LMEM_MOVEABLE);
if(lpList)
*lppList = lpList;
}
return TRUE;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:68,代码来源:clist.c
示例4: md5_starts
uint32 mhmakefileparser::CreateEnvMd5_32() const
{
md5_context ctx;
string Md5;
string EnvVars=ExpandVar(USED_ENVVARS);
const char *pTmp=EnvVars.c_str();
// Now create the md5 string
md5_starts( &ctx );
DBGOUT(cout << "MD5 of " << m_MakeDir->GetQuotedFullFileName() << endl);
while (*pTmp)
{
string Var;
pTmp=NextItem(pTmp,Var,";");
if (!SkipVar(Var))
{
string Val=ExpandVar(Var);
transform(Val.begin(),Val.end(),Val.begin(),(int(__CDECL *)(int))toupper);
DBGOUT(cout << GetMakeDir()->GetQuotedFullFileName() << " -> Setting GetFromEnv var " << Var << " to " << Val << endl);
md5_update( &ctx, (uint8 *) Var.c_str(), (unsigned long)Var.size());
md5_update( &ctx, (uint8 *) "=", 1);
md5_update( &ctx, (uint8 *) Val.c_str(), (unsigned long)Val.size());
}
}
return md5_finish32( &ctx);
}
开发者ID:sheldonrobinson,项目名称:VcXsrv,代码行数:29,代码来源:mhmakefileparser.cpp
示例5: while
bool mhmakefileparser::SkipHeaderFile(const string &FileName)
{
if (!m_SkipHeadersInitialized)
{
m_SkipHeadersInitialized=true;
string HeadersToSkip=ExpandVar(SKIPHEADERS);
const char *pTmp=HeadersToSkip.c_str();
while (*pTmp)
{
string Item;
pTmp=NextItem(pTmp,Item);
if (Item.find('%')==string::npos)
{
m_SkipHeaders.insert(Item);
}
else
{
m_PercentHeaders.push_back(Item);
}
}
}
if (m_SkipHeaders.find(FileName)!=m_SkipHeaders.end())
return true;
vector<string>::const_iterator It=m_PercentHeaders.begin();
vector<string>::const_iterator ItEnd=m_PercentHeaders.end();
while (It!=ItEnd)
{
if (PercentMatch(FileName,*It++))
return true;
}
return false;
}
开发者ID:sheldonrobinson,项目名称:VcXsrv,代码行数:34,代码来源:mhmakefileparser.cpp
示例6: switch
DBObjRecord *DBVectorIF::Item (DBCoordinate coord) const
{
DBObjRecord *record, *retRecord = (DBObjRecord *) NULL;
switch (DataPTR->Type ())
{
case DBTypeVectorPoint:
{
DBFloat dist, minDist = DBHugeVal;
DBObjTableField *coordFLD = ItemTable->Field (DBrNCoord);
DBMathDistanceFunction distFunc = DBMathGetDistanceFunction (DataPTR);
for (record = FirstItem ();record != (DBObjRecord *) NULL;record = NextItem ())
{
dist = DBMathCoordinateDistance (distFunc,coord,coordFLD->Coordinate (record));
if (dist < minDist) { minDist = dist; retRecord = record; }
}
} break;
case DBTypeVectorLine: break;
case DBTypeVectorPolygon: break;
default: CMmsgPrint (CMmsgAppError, "Unknown Vector Data Type in: %s %d",__FILE__,__LINE__); break;
}
return (retRecord);
}
开发者ID:gyelnats,项目名称:RGIS,代码行数:25,代码来源:DBVectorMisc.C
示例7: OnKey
bool OnKey(IInputProvider* pprovider, const KeyState& ks, bool& fForceTranslate)
{
VerifyScrollPos();
if (ks.bDown) {
switch (ks.vk) {
case VK_DOWN:
NextItem();
SelectionChanged();
return true;
case VK_UP:
PreviousItem();
SelectionChanged();
return true;
case VK_PRIOR: // page up
PageUp();
SelectionChanged();
return true;
case VK_NEXT: // page down
PageDown();
SelectionChanged();
return true;
}
}
return false;
}
开发者ID:borgified,项目名称:Allegiance,代码行数:30,代码来源:listpane.cpp
示例8: al_wait_for_event
void CMenuState::HandleEvents(CGameEngine* game)
{
ALLEGRO_EVENT ev;
// wait for an event (mouse movement, key press, etc.)
al_wait_for_event(game->event_queue, &ev);
switch(ev.type) {
case ALLEGRO_EVENT_DISPLAY_CLOSE:
game->Quit();
break;
case ALLEGRO_EVENT_KEY_DOWN:
if(ev.keyboard.keycode == ALLEGRO_KEY_ESCAPE)
game->Quit();
else if(ev.keyboard.keycode == ALLEGRO_KEY_RIGHT)
NextItem();
else if(ev.keyboard.keycode == ALLEGRO_KEY_LEFT)
PrevItem();
else if(ev.keyboard.keycode == ALLEGRO_KEY_ENTER || ev.keyboard.keycode == ALLEGRO_KEY_SPACE)
items[menuIndex]->Activate(game);
break;
}
}
开发者ID:Chase-C,项目名称:Tetris,代码行数:28,代码来源:CMenuState.cpp
示例9: PageDown
void PageDown()
{
int delta = GetSignificantSize() / GetSignificantSize(*m_ppainter);
while (delta > 0) {
NextItem();
delta--;
}
}
开发者ID:borgified,项目名称:Allegiance,代码行数:8,代码来源:listpane.cpp
示例10: Next
static bool Next( playlist_t *p_playlist )
{
playlist_item_t *p_item = NextItem( p_playlist );
if( p_item == NULL )
return false;
msg_Dbg( p_playlist, "starting playback of new item" );
ResyncCurrentIndex( p_playlist, p_item );
return PlayItem( p_playlist, p_item );
}
开发者ID:0xheart0,项目名称:vlc,代码行数:10,代码来源:thread.c
示例11: LoopRequest
static void LoopRequest( playlist_t *p_playlist )
{
playlist_private_t *p_sys = pl_priv(p_playlist);
assert( !p_sys->p_input );
/* No input. Several cases
* - No request, running status -> start new item
* - No request, stopped status -> collect garbage
* - Request, running requested -> start new item
* - Request, stopped requested -> collect garbage
*/
const int i_status = p_sys->request.b_request ?
p_sys->request.i_status : p_sys->status.i_status;
if( i_status == PLAYLIST_STOPPED || !vlc_object_alive( p_playlist ) )
{
p_sys->status.i_status = PLAYLIST_STOPPED;
if( p_sys->p_input_resource &&
input_resource_HasVout( p_sys->p_input_resource ) )
{
/* XXX We can unlock if we don't issue the wait as we will be
* call again without anything else done between the calls */
PL_UNLOCK;
/* input_resource_t must be manipulated without playlist lock */
input_resource_TerminateVout( p_sys->p_input_resource );
PL_LOCK;
}
else
{
if( vlc_object_alive( p_playlist ) )
vlc_cond_wait( &p_sys->signal, &p_sys->lock );
}
return;
}
playlist_item_t *p_item = NextItem( p_playlist );
if( p_item )
{
msg_Dbg( p_playlist, "starting playback of the new playlist item" );
PlayItem( p_playlist, p_item );
return;
}
msg_Dbg( p_playlist, "nothing to play" );
p_sys->status.i_status = PLAYLIST_STOPPED;
if( var_GetBool( p_playlist, "play-and-exit" ) )
{
msg_Info( p_playlist, "end of playlist, exiting" );
libvlc_Quit( p_playlist->p_libvlc );
}
}
开发者ID:Italianmoose,项目名称:Stereoscopic-VLC,代码行数:55,代码来源:thread.c
示例12: Button
MouseResult Button(
IInputProvider* pprovider,
const Point& point,
int button,
bool bCaptured,
bool bInside,
bool bDown
) {
VerifyScrollPos();
if (button == 0 && bDown) {
int nSize = GetSignificantSize(*m_ppainter);
int nSignificantMouseDim = (int)(m_bHorizontal ? point.X(): point.Y());
SetSelection(m_plist->GetItem((nSignificantMouseDim + GetScrollPos()) / nSize));
NeedPaint();
SelectionChanged();
if (pprovider->IsDoubleClick()) {
m_peventDoubleClick->Trigger();
}
else {
m_peventSingleClick->Trigger();
}
}
else if(button == 1 && bDown)
{
int nSize = GetSignificantSize(*m_ppainter);
int nSignificantMouseDim = (int)(m_bHorizontal ? point.X(): point.Y());
SetSelection(m_plist->GetItem((nSignificantMouseDim + GetScrollPos()) / nSize));
NeedPaint();
SelectionChanged();
if (pprovider->IsDoubleClick()) {
m_peventDoubleRightClick->Trigger();
}
else {
m_peventSingleRightClick->Trigger();
}
} else if(button == 8 && bDown) { //Imago 8/14/09 mouse wheel
NextItem();
SelectionChanged();
} else if(button == 9 && bDown) {
PreviousItem();
SelectionChanged();
}
return MouseResult();
}
开发者ID:borgified,项目名称:Allegiance,代码行数:55,代码来源:listpane.cpp
示例13: NextItem
CObject* Search::FindNextObjectOfType( void )
{
CObject* obj = NextItem();
while ( obj )
{
Dbg_AssertType( obj, CObject );
if ( obj->GetType() == obj_type )
{
return obj;
}
obj = NextItem();
}
return obj;
}
开发者ID:basecq,项目名称:thug,代码行数:20,代码来源:objsearch.cpp
示例14: casesin
/*****************************************************************************
*
* casesin takes a list of selections 'tptr' and returns the number of
* distinct selections (including an ELSE if one present).
*
*****************************************************************************/
PRIVATE int casesin (treenode * tptr)
{
int n = 0;
for (; !EndOfList (tptr); tptr = NextItem (tptr)) {
treenode *thisguard = CondGuardOf (skipspecifications (ThisItem (tptr)));
if (TagOf (thisguard) == S_ELSE)
n++;
else
n += listitems (thisguard);
}
return (n);
}
开发者ID:bsmr-misc-forks,项目名称:kroc,代码行数:18,代码来源:gen9.c
示例15: while
long
DCirfile::GetItemCount(void)
{
long count = 0;
while (NextItem())
count++;
Section(CurrSectName);
return count;
}
开发者ID:omsys-dev,项目名称:original-source,代码行数:12,代码来源:dcfili.cpp
示例16: MoveItemFirst
void MoveItemFirst(long ptr)
{
long next, prev, first, loc0, root;
/* Check pointer */
CheckPointer(FUNCTION_NAME, "(ptr)", DATA_ARRAY, ptr);
/* Get pointer to common data */
loc0 = (long)RDB[ptr + LIST_PTR_COMMON];
CheckPointer(FUNCTION_NAME, "(loc0)", DATA_ARRAY, loc0);
/* Get pointers to previous and next items */
prev = PrevItem(ptr);
next = NextItem(ptr);
/* Check if already first and put pointer */
if (prev < VALID_PTR)
return;
else
WDB[prev + LIST_PTR_NEXT] = (double)next;
/* Check if last and put pointer */
if (next < VALID_PTR)
WDB[loc0 + LIST_COMMON_PTR_LAST] = (double)prev;
else
WDB[next + LIST_PTR_PREV] = (double)prev;
/* Get pointer to first */
first = (long)RDB[loc0 + LIST_COMMON_PTR_FIRST];
CheckPointer(FUNCTION_NAME, "(first)", DATA_ARRAY, first);
/* Put pointers */
WDB[first + LIST_PTR_PREV] = (double)ptr;
WDB[ptr + LIST_PTR_NEXT] = (double)first;
WDB[ptr + LIST_PTR_PREV] = NULLPTR;
WDB[loc0 + LIST_COMMON_PTR_FIRST] = (double)ptr;
/* Get pointer to root */
root = (long)RDB[loc0 + LIST_COMMON_PTR_ROOT];
/* Put pointer */
WDB[root] = (double)ptr;
}
开发者ID:LMKerby,项目名称:SerpentCouplerII,代码行数:52,代码来源:moveitemfirst.c
示例17: Reset
///<summary>Deletes all items from the data store.</summary>
void CFeedStore::ClearItems()
{
CRSSItem* rssItem;
Reset();
while ((rssItem=NextItem())!=NULL)
DeleteItem(rssItem);
//-- Finally delete everything in the root of the feedstore
QStringListIterator feedStoreI=FeedStoreDir.entryList(QDir::Files|QDir::NoDotAndDotDot);
while (feedStoreI.hasNext())
FeedStoreDir.remove(feedStoreI.next());
}
开发者ID:TodorGrin,项目名称:boox-opensource,代码行数:14,代码来源:feedStore.cpp
示例18: SHFindDataBlock
/*************************************************************************
* @ [SHLWAPI.22]
*
* Find an item in a DataBlock list.
*
* PARAMS
* lpList [I] List to search
* ulId [I] Id of item to find
*
* RETURNS
* Success: A pointer to the list item found
* Failure: NULL
*
* NOTES
* See SHWriteDataBlockList.
*/
LPSHLWAPI_CLIST WINAPI SHFindDataBlock(LPSHLWAPI_CLIST lpList, ULONG ulId)
{
TRACE("(%p,%ld)\n", lpList, ulId);
if(lpList)
{
while(lpList->ulSize)
{
if(lpList->ulId == ulId)
return lpList; /* Matched */
else if(lpList->ulId == CLIST_ID_CONTAINER && lpList[1].ulId == ulId)
return lpList + 1; /* Contained item matches */
lpList = NextItem(lpList);
}
}
return NULL;
}
开发者ID:howard5888,项目名称:wineT,代码行数:34,代码来源:clist.c
示例19: SHFindDataBlock
/*************************************************************************
* @ [SHLWAPI.22]
*
* Find an item in a DataBlock list.
*
* PARAMS
* lpList [I] List to search
* dwSignature [I] Id of item to find
*
* RETURNS
* Success: A pointer to the list item found
* Failure: NULL
*
* NOTES
* See SHWriteDataBlockList.
*/
DATABLOCK_HEADER* WINAPI SHFindDataBlock(LPDBLIST lpList, DWORD dwSignature)
{
TRACE("(%p,%d)\n", lpList, dwSignature);
if(lpList)
{
while(lpList->cbSize)
{
if(lpList->dwSignature == dwSignature)
return lpList; /* Matched */
else if(lpList->dwSignature == CLIST_ID_CONTAINER && lpList[1].dwSignature == dwSignature)
return lpList + 1; /* Contained item matches */
lpList = NextItem(lpList);
}
}
return NULL;
}
开发者ID:hoangduit,项目名称:reactos,代码行数:34,代码来源:clist.c
示例20: ScorePB
void ScorePB(double fissE, double wgt, long id)
{
long pbd, pbl, ptr, ncol, idx;
/* Check pointer */
if ((pbd = (long)RDB[DATA_PTR_PB0]) < 0)
return;
/* Check fission energy */
if (fissE < ZERO)
return;
/* Get collision number */
ptr = (long)RDB[DATA_PTR_COLLISION_COUNT];
ncol = (long)GetPrivateData(ptr, id);
/* Loop over geometries */
while (pbd > 0)
{
/* Get pointer to pebble where collision occured */
if ((ptr = (long)RDB[pbd + PBED_PTR_POW]) > VALID_PTR)
if ((pbl = TestValuePair(pbd + PBED_PTR_COL_PEBBLE, ncol, id))
> VALID_PTR)
{
/* Get pebble index */
idx = (long)RDB[pbl + PEBBLE_IDX];
/* Score */
AddBuf1D(fissE, wgt, ptr, id, idx);
}
/* Next */
pbd = NextItem(pbd);
}
}
开发者ID:LMKerby,项目名称:SerpentCouplerII,代码行数:43,代码来源:scorepb.c
注:本文中的NextItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论