//-----------------------------------------------------------------------------+ // Copyright (C), 1998-2007, SH Software Co. Ltd. // = FileName : LoopList Ä£°åÀà // = Version : ver2.0 // = Author : zjq // = CreateDate : 2002-09-09 // = Description: LoopList ÉùÃ÷ // = Maintainers: // //-----------------------------------------------------------------------------+ #ifndef _LoopList_H_ #define _LoopList_H_ #ifndef _DLIST_H_ #include "DList.h" #endif #include "xglobalfunc.h" template class LoopList : public DList { public: LoopList(); ~LoopList(){} R * operator [](int n); const R & operator [](int n) const; const R & GetAt(int n) const; R * GetAt(int n); void RemoveNode(int n); }; template LoopList::LoopList() { } template R * LoopList::operator [](int n) { int nLen=this->Length(); n = XExport::LimitCycle(n, nLen); return DList::operator[](n); } template const R & LoopList::operator [](int n) const { int nLen=this->Length(); n = XExport::LimitCycle(n, nLen); const DList &rThis=*this; return rThis[n]; } template R * LoopList::GetAt(int n) { int nLen = this->Length(); n = XExport::LimitCycle(n, nLen); return DList::GetAt(n); } template const R & LoopList::GetAt(int n) const { int nLen = this->Length(); n = XExport::LimitCycle(n, nLen); const DList &rThis = *this; return rThis.GetAt(n); } template void LoopList::RemoveNode(int n) { (*this)[n]; this->Remove(); } #endif