Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

91 lines
1.3 KiB

//*************************************************************
//
// Copyright (c) Microsoft Corporation 1998
// All rights reserved
//
// list.hxx
//
//*************************************************************
#if !defined(__LIST_HXX__)
#define __LIST_HXX__
class CListItem
{
friend class CList;
public:
CListItem() : _pPrev(0), _pNext(0) {}
void
Remove();
void
InsertBefore(
IN CListItem * pItem
);
private:
CListItem * _pPrev;
CListItem * _pNext;
};
class CList
{
public:
CList();
void
InsertLIFO(
IN CListItem * pItem
);
void
InsertFIFO(
IN CListItem * pItem
);
//
// Interation methods.
//
inline void
Reset()
{
_pCurrentSave = _pCurrent;
_pCurrent = _Head._pNext;
}
inline BOOL
MoveNext()
{
_pCurrent = _pCurrent->_pNext;
return (_pCurrent != &_Head);
}
inline CListItem *
GetCurrentItem()
{
return (_pCurrent != &_Head) ? _pCurrent : NULL;
}
inline void
ResetEnd()
{
_pCurrent = _pCurrentSave;
}
private:
CListItem _Head;
CListItem * _pCurrent;
CListItem * _pCurrentSave;
};
#endif // __LIST_HXX__