diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-14 00:50:34 +0100 |
commit | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (patch) | |
tree | eaf6e857382eef16c2dd940eb4125536fbe068bd /src/T2DLL/CLink.h | |
download | t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.tar.gz t2win-37e364b2c6cc7487a1c888d256a73e5337bb7189.zip |
initial commit
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/CLink.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/T2DLL/CLink.h b/src/T2DLL/CLink.h new file mode 100644 index 0000000..3e8988b --- /dev/null +++ b/src/T2DLL/CLink.h @@ -0,0 +1,37 @@ +#pragma once +#include "common.h" + +class DLL_EXPORT CLink { +public: + CLink(); + CLink(CLink* prev); + virtual ~CLink(); + void InsertAt(CLink* before); + void Remove(); + void RemoveLink(); + unsigned int Count() const; + + CLink* GetNext() { return mNext; } + CLink* GetPrev() { return mPrev; } + void SetNext(CLink* l) { mNext = l; } + void SetPrev(CLink* l) { mPrev = l; } + +private: + CLink *mNext; + CLink *mPrev; + + friend class CLinkIterator; +}; + +class DLL_EXPORT CLinkIterator { +public: + CLinkIterator(CLink* start); + virtual ~CLinkIterator(); + BOOL Current(CLink** p); + BOOL Prev(CLink** p); + BOOL Next(CLink** p); + +private: + CLink *mStart; + CLink *mCurrent; +}; |