#ifndef __MZSTD_LINK_LIST_H__
#define __MZSTD_LINK_LIST_H__

#include "mzstdCommon.h"
#include "mzObject.h"

namespace mzstd {

class DECLSPEC_MZSTD CmzLinkListNode : public CmzObject {
public:
    LONG data;
    CmzLinkListNode* next;
};
typedef CmzLinkListNode* PLinkListNode;

class DECLSPEC_MZSTD CmzLinkList : public CmzObject {
public:
    WINAPI CmzLinkList();
    WINAPI ~CmzLinkList();

    VOID WINAPI append(LONG data);
    inline VOID WINAPI push(LONG data) { this->append(data); }
    LONG WINAPI pop();
    VOID WINAPI addAsFirst(LONG data);
    VOID WINAPI addAfter(ULONG pos, LONG data);
    ULONG WINAPI del(LONG data);
    BOOL WINAPI delFirst(LONG data);
    BOOL WINAPI del(ULONG pos);
    LONG WINAPI getAt(ULONG pos);
    LONG WINAPI pos(LONG data);
    BOOL WINAPI contains(LONG data);
    inline ULONG WINAPI size() { return this->_size; };
    inline CmzLinkListNode* WINAPI first() { return this->_head; }
    inline CmzLinkListNode* WINAPI lastNode() { return this->_last; }
    VOID WINAPI clear();
private:
    CmzLinkListNode *_head;
    CmzLinkListNode *_last;
    ULONG _size;
};

}

#endif
